Skip to content

Commit f8698b0

Browse files
authored
v0.1.0
* initial gem framework (#1)
1 parent 934135a commit f8698b0

File tree

12 files changed

+167
-1
lines changed

12 files changed

+167
-1
lines changed

CHANGELOG.md

Whitespace-only changes.

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "https://rubygems.org"
2+
3+
# Specify your gem's dependencies in grift.gemspec
4+
gemspec
5+
6+
gem "minitest", "~> 5.0"
7+
gem "rake", "~> 12.0"

Gemfile.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
PATH
2+
remote: .
3+
specs:
4+
grift (0.1.0)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
minitest (5.14.4)
10+
rake (12.3.3)
11+
12+
PLATFORMS
13+
ruby
14+
15+
DEPENDENCIES
16+
grift!
17+
minitest (~> 5.0)
18+
rake (~> 12.0)
19+
20+
BUNDLED WITH
21+
2.1.4

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# grift
1+
# Grift
2+
23
Mocking and spying in Ruby's MiniTest framework
4+
5+
## Installation
6+
7+
Add this line to your application's Gemfile:
8+
9+
```ruby
10+
gem 'grift'
11+
```
12+
13+
And then execute:
14+
15+
```shell
16+
bundle install
17+
```
18+
19+
Or install it yourself as:
20+
21+
```shell
22+
gem install grift
23+
```
24+
25+
## Usage
26+
27+
TODO: Write usage instructions here
28+
29+
## Development
30+
31+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32+
33+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34+
35+
## Contributing
36+
37+
Bug reports and pull requests are welcome on GitHub at [clarkedb/grift](https://github.com/clarkedb/grift).

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
require 'bundler/gem_tasks'
4+
require 'rake/testtask'
5+
6+
Rake::TestTask.new(:test) do |t|
7+
t.libs << 'test'
8+
t.libs << 'lib'
9+
t.test_files = FileList['test/**/*_test.rb']
10+
end
11+
12+
task default: :test

bin/console

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'bundler/setup'
4+
require 'grift'
5+
6+
# You can add fixtures and/or initialization code here to make experimenting
7+
# with your gem easier. You can also use a different console, if you like.
8+
9+
# (If you use this, don't forget to add pry to your Gemfile!)
10+
# require "pry"
11+
# Pry.start
12+
13+
require 'irb'
14+
IRB.start(__FILE__)

bin/setup

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
set -vx
5+
6+
bundle install
7+
8+
# Do any other automated setup that you need to do here

grift.gemspec

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require_relative 'lib/grift/version'
2+
3+
Gem::Specification.new do |spec|
4+
spec.name = 'grift'
5+
spec.version = Grift::VERSION
6+
spec.authors = ['Clark Brown']
7+
spec.email = ['[email protected]']
8+
9+
spec.summary = 'Mocking and spying in MiniTest'
10+
spec.description = "A gem for simple mocking and spying in Ruby's MiniTest framework."
11+
spec.homepage = 'https://github.com/clarkedb/grift'
12+
spec.license = 'MIT'
13+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
14+
15+
spec.metadata = {
16+
'bug_tracker_uri' => "#{spec.homepage}/issues",
17+
'changelog_uri' => "#{spec.homepage}/blob/main/CHANGELOG.md",
18+
'documentation_uri' => spec.homepage.to_s,
19+
'homepage_uri' => spec.homepage.to_s,
20+
'source_code_uri' => spec.homepage.to_s
21+
}
22+
23+
# Specify which files should be added to the gem when it is released.
24+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
26+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|docs|spec|features)/}) }
27+
end
28+
spec.bindir = 'exe'
29+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30+
spec.require_paths = ['lib']
31+
end

lib/grift.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
require 'grift/version'
4+
5+
module Grift
6+
class Error < StandardError; end
7+
8+
#
9+
# The base class for all of Grift
10+
#
11+
class Base
12+
def self.mock(klass, func, _ret_value)
13+
puts "Not implemented, but this would mock #{func} on #{klass}"
14+
end
15+
end
16+
end

lib/grift/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Grift
2+
VERSION = "0.1.0"
3+
end

0 commit comments

Comments
 (0)