pry-factorybot 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02d4dfc3a270fe500fed7209cdb5ca525ce774ac5e194d8813595adf7b2c32d5
4
- data.tar.gz: c45ff87ea937040573246cc314520332c0e3ebd0b087b47b18e0917ca8074fff
3
+ metadata.gz: f1cffb598b722cb2c5977d4b7b821e92b8769219f01994eb346728b0851b1086
4
+ data.tar.gz: a4e533fbe12e126fbbb2f9440bd14f13626af71e5b2da0c864938e9b84b68992
5
5
  SHA512:
6
- metadata.gz: 37f1521f3cf903b3acf771f3013ccb70816dc01dcd65d455d8f3e1a9da5bf9c751de035339954034a9bae5a8f565d9d27baa69d4a079ef6323f2c71d271471a6
7
- data.tar.gz: e6dc7787c148cb71415b17e6ee8ed78d10890ca857a4fbc50773f121c2e3c8b471ea97d29e92e56fc376590417508bf4973b3de4c1e54ef6e3f4746e7b10e234
6
+ metadata.gz: 93aa6fa59f4dcfff14c2a25a42c032c7ee531260da0364f8a7c770030c2097d0e10b81491b2c16f70ec14876ad40a79d6d2a1b0b7baaa495a046b62ccfbd2ddb
7
+ data.tar.gz: 24187a6d8a4466833c901238f259cb0e691efdb98882b3fa707f7fbc3791e29108ac58b49b5f0da6b58887c84a69c83e0ba8866313671a66c4ccf2b1d47483b3
data/Gemfile CHANGED
@@ -2,5 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- # Specify your gem's dependencies in pry-factory_bot.gemspec
5
+ # Specify your gem's dependencies in pry-factorybot.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-factorybot (0.1.0)
4
+ pry-factorybot (0.1.2)
5
5
  factory_bot
6
6
  pry (~> 0.10)
7
7
 
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-factory_bot'
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-factory_bot
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-factory_bot. 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.
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-factory_bot/blob/master/CODE_OF_CONDUCT.md).
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).
@@ -1,3 +1,3 @@
1
1
  module PryFactorybot
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,34 +1,20 @@
1
1
  require 'pry'
2
- require 'pry-factorybot'
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
- DEFAULT_STRATEGIES_NAMES.each do |strategy_name|
9
- class_eval <<-EOS
10
- class FactoryBot#{strategy_name.capitalize}Command < ::Pry::ClassCommand
11
- match "#{strategy_name}"
12
- group "FactorBot"
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
- EOS
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.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 00:00:00.000000000 Z
11
+ date: 2019-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry