pry-factorybot 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/pry-factorybot/version.rb +1 -1
- data/lib/pry-factorybot.rb +11 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1cffb598b722cb2c5977d4b7b821e92b8769219f01994eb346728b0851b1086
|
4
|
+
data.tar.gz: a4e533fbe12e126fbbb2f9440bd14f13626af71e5b2da0c864938e9b84b68992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93aa6fa59f4dcfff14c2a25a42c032c7ee531260da0364f8a7c770030c2097d0e10b81491b2c16f70ec14876ad40a79d6d2a1b0b7baaa495a046b62ccfbd2ddb
|
7
|
+
data.tar.gz: 24187a6d8a4466833c901238f259cb0e691efdb98882b3fa707f7fbc3791e29108ac58b49b5f0da6b58887c84a69c83e0ba8866313671a66c4ccf2b1d47483b3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'pry-
|
12
|
+
gem 'pry-factorybot'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -18,7 +18,7 @@ And then execute:
|
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
$ gem install pry-
|
21
|
+
$ gem install pry-factorybot
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pry-
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pry-factorybot. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
36
|
|
37
37
|
## License
|
38
38
|
|
@@ -40,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
40
|
|
41
41
|
## Code of Conduct
|
42
42
|
|
43
|
-
Everyone interacting in the Pry::Factorybot project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pry-
|
43
|
+
Everyone interacting in the Pry::Factorybot project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pry-factorybot/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/pry-factorybot.rb
CHANGED
@@ -1,34 +1,20 @@
|
|
1
1
|
require 'pry'
|
2
|
-
require '
|
2
|
+
require 'factory_bot'
|
3
3
|
|
4
4
|
module PryFactoryBot
|
5
5
|
# TODO FactoryBot::Internal::DEFAULT_STRATEGIESでとれるようになるかも?
|
6
|
-
DEFAULT_STRATEGIES_NAMES = [:build, :create, :attributes_for, :build_stubbed, :null
|
6
|
+
DEFAULT_STRATEGIES_NAMES = [:build, :create, :attributes_for, :build_stubbed, :null].freeze
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
description "FactorBot.#{strategy_name}"
|
15
|
-
|
16
|
-
banner <<-BANNER
|
17
|
-
Usage: #{strategy_name}
|
18
|
-
FactorBot.create.
|
19
|
-
BANNER
|
20
|
-
|
21
|
-
def process(name, *traits_and_overrides, &block)
|
22
|
-
::FactoryBot.#{strategy_name}(name, *traits_and_overrides, &block)
|
23
|
-
rescue => e
|
24
|
-
puts e.message
|
25
|
-
end
|
8
|
+
Commands = Pry::CommandSet.new do
|
9
|
+
DEFAULT_STRATEGIES_NAMES.each do |strategy|
|
10
|
+
command "#{strategy}", "FactoryBot.#{strategy}" do
|
11
|
+
FactoryBot.class_eval <<-EOS
|
12
|
+
#{Readline::HISTORY.to_a.last}
|
13
|
+
EOS
|
26
14
|
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
DEFAULT_STRATEGIES_NAMES.each do |strategy_name|
|
31
|
-
eval "Pry::Commands.add_command(PryFactoryBot::FactoryBot#{strategy_name.capitalize}Command)"
|
15
|
+
end
|
32
16
|
end
|
33
17
|
end
|
34
18
|
|
19
|
+
Pry.config.commands.import PryFactoryBot::Commands
|
20
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-factorybot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiroaki.osawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|