rails_script 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: e1158eac848d3653884eb4a115085124d41cb56a
4
- data.tar.gz: 8fa77658f9637b99cc3dc770c271c640ccd3c4f6
3
+ metadata.gz: b140ec8cf5abca9db947d6906e1fc6596ad463ea
4
+ data.tar.gz: 3232f9946d02bc6a8127758ec414257a93be4317
5
5
  SHA512:
6
- metadata.gz: b9e718d2fc47235da59cf1205528b494174e3f0269375099931eccd64240f4000e400458b12a6e3b524ea2db60f81a5c2d2f47d01a7fd6513cd060b7dd33c1d9
7
- data.tar.gz: 45a80a07e93adbc9da211fb5c6dbc5770c8e3047ac0dfac0eca2f34bbe746de27b16f1a405a618f4bc1c897876d048fa6adaf690d953aef4b2d0254ab4313e6a
6
+ metadata.gz: 859959d690d0211b07db596f6633d6ae063a18e12d1ac1ef57d8759a1e34ffac5600c9af98a4beb7e771969ad4b723260c50cda086e8b906f275e5a2bd94f72d
7
+ data.tar.gz: 722f1fd7fa70c6f3534f2e5b96b9d5bfc48bdec4983783b0ccadc9d507f173b8f25dc938c9d5f85c3c9ae49c4b47c44efcabdac37a61410e2b109ed71696cd5b
data/README.md CHANGED
@@ -117,9 +117,8 @@ This will create the following in ```/app/assets/javascripts/utilities/modal.js.
117
117
 
118
118
  ```
119
119
  # /app/assets/javascripts/utilities/modal.js.coffee
120
- window.App ||= {}
121
- window.App.Utility ||= {}
122
- class App.Utility.Modal
120
+ window.Utility ||= {}
121
+ class Utility.Modal
123
122
 
124
123
  constructor: ->
125
124
  return this
@@ -129,9 +128,8 @@ Let's add some basic functionality:
129
128
 
130
129
  ```
131
130
  # /app/assets/javascripts/utilities/modal.js.coffee
132
- window.App ||= {}
133
- window.App.Utility ||= {}
134
- class App.Utility.Modal
131
+ window.Utility ||= {}
132
+ class Utility.Modal
135
133
  @element
136
134
  @trigger
137
135
  @isOpen = false
@@ -167,7 +165,7 @@ window.App ||= {}
167
165
  class App.Users extends App.Base
168
166
 
169
167
  show: ->
170
- @galleryModal = new App.Utility.Modal($('#user-gallery-modal-wrapper'), $('user-gallery-modal-toggle-button'))
168
+ @galleryModal = new Utility.Modal($('#user-gallery-modal-wrapper'), $('user-gallery-modal-toggle-button'))
171
169
 
172
170
  ```
173
171
 
@@ -185,8 +183,8 @@ This will create the following in ```/app/assets/javascripts/elements/main_menu.
185
183
  ```
186
184
  # /app/assets/javascripts/elements/main_menu.js.coffee```
187
185
 
188
- window.App.Element ||= {}
189
- class App.Element.MainMenu
186
+ window.Element ||= {}
187
+ class Element.MainMenu
190
188
 
191
189
  constructor: ->
192
190
  return this
@@ -201,7 +199,7 @@ window.App ||= {}
201
199
  class App.Base
202
200
 
203
201
  constructor: ->
204
- App.mainMenu = new App.Element.MainMenu()
202
+ App.mainMenu = new Element.MainMenu()
205
203
  return this
206
204
  ```
207
205
 
@@ -217,8 +215,8 @@ Which generates:
217
215
  ````
218
216
  # /app/assets/javascripts/elements/main_menu.js.coffee
219
217
 
220
- window.App.Element ||= {}
221
- class App.Element.MainMenu extends App.Utility.Modal
218
+ window.Element ||= {}
219
+ class Element.MainMenu extends Utility.Modal
222
220
 
223
221
  constructor: ->
224
222
  return this
@@ -1,6 +1,5 @@
1
- window.App ||= {}
2
- window.App.Element ||= {}
3
- class App.Element.<%= element_name.gsub('::', '') %> <%= "extends App.Utility.#{utility.gsub('::', '')}" unless utility.blank? %>
1
+ window.Element ||= {}
2
+ class Element.<%= element_name.gsub('::', '') %> <%= "extends Utility.#{utility.gsub('::', '')}" unless utility.blank? %>
4
3
 
5
4
  constructor: ->
6
5
  super
@@ -17,17 +17,17 @@ module RailsScript
17
17
  if File.exist?('app/assets/javascripts/application.js')
18
18
 
19
19
  if File.readlines('app/assets/javascripts/application.js').grep('//= require_tree .').any?
20
- inject_into_file 'app/assets/javascripts/application.js', "\n//= require base\n//= require_tree ./utilities", before: "\n//= require_tree ."
20
+ inject_into_file 'app/assets/javascripts/application.js', "\n//= require base\n//= require_tree ./utilities\n//= require_tree ./elements", before: "\n//= require_tree ."
21
21
  else
22
- append_file 'app/assets/javascripts/application.js', "\n//= require base\n//= require_tree ./utilities\n//= require_tree ."
22
+ append_file 'app/assets/javascripts/application.js', "\n//= require base\n//= require_tree ./utilities\n//= require_tree ./elements\n//= require_tree ."
23
23
  end
24
24
 
25
25
  elsif File.exist?('app/assets/javascripts/application.js.coffee')
26
26
 
27
27
  if File.readlines('app/assets/javascripts/application.js.coffee').grep('#= require_tree .').any?
28
- inject_into_file 'app/assets/javascripts/application.js.coffee', "\n#= require base\n#= require_tree ./utilities", before: "\n#= require_tree ."
28
+ inject_into_file 'app/assets/javascripts/application.js.coffee', "\n#= require base\n#= require_tree ./utilities\n#= require_tree ./elements", before: "\n#= require_tree ."
29
29
  else
30
- append_file 'app/assets/javascripts/application.js.coffee', "\n#= require base\n#= require_tree ./utilities\n#= require_tree ."
30
+ append_file 'app/assets/javascripts/application.js.coffee', "\n#= require base\n#= require_tree ./utilities\n#= require_tree ./elements\n#= require_tree ."
31
31
  end
32
32
  end
33
33
  end
@@ -1,6 +1,5 @@
1
- window.App ||= {}
2
- window.App.Utility ||= {}
3
- class App.Utility.<%= utility_name.gsub('::', '') %>
1
+ window.Utility ||= {}
2
+ class Utility.<%= utility_name.gsub('::', '') %>
4
3
 
5
4
  constructor: ->
6
5
  super
@@ -1,3 +1,3 @@
1
1
  module RailsScript
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_script
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pheasey