ror_generators 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f97e275974b99ac44bb312c93d90317043ec5de0
4
- data.tar.gz: 821f047a16093431d1cab36a34a88171ba1fc635
3
+ metadata.gz: 4529655c25eec37febca49f02235cd57fafdf998
4
+ data.tar.gz: 386ecc3a27090cd9e8447256dca344d8c7096e7c
5
5
  SHA512:
6
- metadata.gz: 198b25837f4645710a3693e218531721d86f77635b2ced5a3052b38b576751b383039e87364f732ec8f8cda70e9bb8a78989ef871c407d8f2960ea43df2a3053
7
- data.tar.gz: c6293fcef1229243aabe6ae9be00293948b0090120071f952633ae6067391fb1d484eb7cacbdb546dfdaa0d6f1d1d7807b59cc57ea5297e0d57331cccf00477f
6
+ metadata.gz: d120cfa226503cd31203c6d83fb44ba305f887ad3e145ae6348f4e3269e93c859c2a73a6eccc1338b58e217d5a1965f3023e7b3bbe24ea5aea73ef02891c1ab5
7
+ data.tar.gz: 8a85a4169cbb86fb89719004ccc505579ce29880f1cee5e66f106610bed10217221cdf99f6f6a1972611c6b05e3ecabdabc721addf1ac405e8e6da1f03713362
@@ -1,4 +1,5 @@
1
1
  require "rails/generators"
2
+ require "pry"
2
3
 
3
4
  module RorGenerators
4
5
  module Generators
@@ -47,15 +48,22 @@ module RorGenerators
47
48
  end
48
49
 
49
50
  def copy_webpack_config
50
- if dest_file_exists?("client/webpack.config.js")
51
- inject_into_file "client/webpack.config.js", after: "'babel-polyfill',\n" do
52
- "\t\t\t'./app/bundles/#{module_name}/startup/registration',\n"
53
- end unless in_bundle?
54
- else
51
+ if !dest_file_exists?("client/webpack.config.js")
55
52
  template "client/webpack.config.js.erb", "client/webpack.config.js"
56
53
  end
57
54
  end
58
55
 
56
+ def add_file_to_bundle
57
+ if dest_file_exists?("client/webpack.config.js")
58
+ if not_in_bundle?
59
+ puts "not in bundle"
60
+ inject_into_file "client/webpack.config.js", after: "'babel-polyfill',\n" do
61
+ "\t\t\t'./app/bundles/#{module_name}/startup/registration',\n"
62
+ end
63
+ end
64
+ end
65
+ end
66
+
59
67
  def copy_package_json
60
68
  template "client/package.json.tt", "client/package.json" unless dest_file_exists?("client/package.json")
61
69
  end
@@ -132,10 +140,13 @@ module RorGenerators
132
140
  File.open(client_package_json, "w+") { |f| f.puts contents }
133
141
  end
134
142
 
135
- def in_bundle?
136
- File.readlines('client/webpack.config.js').find do |line|
137
- line.match("'./app/bundles/#{module_name}/startup/registration',\n")
143
+ def not_in_bundle?
144
+ if Pathname.new('client/webpack.config.js').file?
145
+ match = File.readlines('client/webpack.config.js').find do |line|
146
+ line.include?("#{module_name}/startup/registration")
147
+ end
138
148
  end
149
+ match.nil?
139
150
  end
140
151
 
141
152
  end
@@ -21,7 +21,6 @@ const config = {
21
21
  'es5-shim/es5-shim',
22
22
  'es5-shim/es5-sham',
23
23
  'babel-polyfill',
24
- './app/bundles/<%= module_name %>/startup/registration',
25
24
  ],
26
25
  },
27
26
 
@@ -1,3 +1,3 @@
1
1
  module RorGenerators
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "rake", "~> 10.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
37
  spec.add_development_dependency "gem-release"
38
+ spec.add_development_dependency "pry"
39
+ spec.add_development_dependency "pry-rescue"
38
40
 
39
41
  spec.add_development_dependency "generator_spec"
40
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ror_generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dakota Martinez
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry-rescue
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: generator_spec
85
113
  requirement: !ruby/object:Gem::Requirement