initjs 1.0.1 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -6
- data/{spec/dummy/.rspec → .rspec} +0 -0
- data/.ruby-version +1 -1
- data/.travis.yml +1 -6
- data/Gemfile.lock +143 -0
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +199 -59
- data/Rakefile +6 -0
- data/initjs.gemspec +0 -1
- data/lib/assets/javascript/init.js.coffee +88 -38
- data/lib/generators/initjs/add/templates/namespaced_action.coffee +4 -1
- data/lib/generators/initjs/add/templates/simple_action.coffee +4 -1
- data/lib/generators/initjs/install/install_generator.rb +1 -1
- data/lib/generators/initjs/install/templates/app.coffee +13 -8
- data/lib/initjs/helper.rb +9 -3
- data/lib/initjs/version.rb +1 -1
- data/spec/dummy/Gemfile.lock +143 -0
- data/spec/dummy/app/assets/javascripts/dummy/dummy.js.coffee +6 -9
- data/spec/dummy/app/assets/javascripts/dummy/home/index.js.coffee +3 -2
- data/spec/dummy/app/views/layouts/application.html.erb +1 -1
- data/spec/dummy/config/application.rb +4 -1
- data/spec/dummy/config/environments/test.rb +1 -3
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/{tmp → dummy/tmp}/app/assets/javascripts/.gitkip +0 -0
- data/spec/{dummy/spec/features → features}/blog_posts_spec.rb +0 -0
- data/spec/{dummy/spec/features → features}/home_spec.rb +0 -0
- data/spec/{dummy/spec/features → features}/posts_spec.rb +0 -0
- data/spec/{dummy/spec/lib → lib}/generators/initjs/add_generator_spec.rb +0 -0
- data/spec/{dummy/spec/lib → lib}/generators/initjs/install_generator_spec.rb +0 -0
- data/spec/{dummy/spec/spec_helper.rb → spec_helper.rb} +5 -5
- metadata +37 -79
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/db/seeds.rb +0 -7
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 37100766dbef555f1cf31995e10ceb40273014c3
|
4
|
+
data.tar.gz: 8b59651ca232795e2b6909d81643fe7c02e2af69
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 795105fa66ef88900eb0e169b9be59102faf28467b4e79e5c6c6d1403ff080a6348e0f0bc905374feffc322317ffdf3d57621a1077761a3de90b11af290c3b32
|
7
|
+
data.tar.gz: ae8e4ddce8da60105b549a74fd3968a17359ba23fba9583fee78a412c352b1f061e1386e3b739eb87ab3f14bf7ba15162d989ab2b43686ff7502f942e5a6e1cd
|
data/.gitignore
CHANGED
@@ -2,15 +2,12 @@
|
|
2
2
|
*.rbc
|
3
3
|
.bundle
|
4
4
|
.config
|
5
|
-
Gemfile.lock
|
6
5
|
pkg
|
7
6
|
rdoc
|
8
|
-
spec/tmp/app/assets/javascripts/application.js
|
9
|
-
spec/tmp/app/assets/javascripts/dummy/
|
10
|
-
|
11
|
-
# Ignore the default SQLite database.
|
12
|
-
spec/dummy/db/*.sqlite3
|
7
|
+
spec/dummy/tmp/app/assets/javascripts/application.js
|
8
|
+
spec/dummy/tmp/app/assets/javascripts/dummy/
|
13
9
|
|
14
10
|
# Ignore all logfiles and tempfiles.
|
15
11
|
spec/dummy/log/*.log
|
16
12
|
spec/dummy/tmp
|
13
|
+
spec/dummy/db/schema.rb
|
File without changes
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/.travis.yml
CHANGED
@@ -1,15 +1,10 @@
|
|
1
1
|
rvm:
|
2
|
-
- 1.9.3
|
3
2
|
- 2.0.0
|
4
3
|
|
5
|
-
gemfile: "spec/dummy/Gemfile"
|
6
|
-
|
7
4
|
env:
|
8
5
|
- DISPLAY=:99.0
|
9
6
|
|
10
7
|
before_script:
|
11
8
|
- "sh -e /etc/init.d/xvfb start"
|
12
|
-
- "cd spec/dummy"
|
13
|
-
- "bundle exec rake db:migrate"
|
14
9
|
|
15
|
-
script: "bundle exec
|
10
|
+
script: "bundle exec rake spec"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
initjs (2.0.0.beta1)
|
5
|
+
jquery-rails
|
6
|
+
rails (>= 3.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (4.0.0)
|
12
|
+
actionpack (= 4.0.0)
|
13
|
+
mail (~> 2.5.3)
|
14
|
+
actionpack (4.0.0)
|
15
|
+
activesupport (= 4.0.0)
|
16
|
+
builder (~> 3.1.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
rack (~> 1.5.2)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
activemodel (4.0.0)
|
21
|
+
activesupport (= 4.0.0)
|
22
|
+
builder (~> 3.1.0)
|
23
|
+
activerecord (4.0.0)
|
24
|
+
activemodel (= 4.0.0)
|
25
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
26
|
+
activesupport (= 4.0.0)
|
27
|
+
arel (~> 4.0.0)
|
28
|
+
activerecord-deprecated_finders (1.0.3)
|
29
|
+
activesupport (4.0.0)
|
30
|
+
i18n (~> 0.6, >= 0.6.4)
|
31
|
+
minitest (~> 4.2)
|
32
|
+
multi_json (~> 1.3)
|
33
|
+
thread_safe (~> 0.1)
|
34
|
+
tzinfo (~> 0.3.37)
|
35
|
+
arel (4.0.1)
|
36
|
+
atomic (1.1.14)
|
37
|
+
builder (3.1.4)
|
38
|
+
capybara (2.0.3)
|
39
|
+
mime-types (>= 1.16)
|
40
|
+
nokogiri (>= 1.3.3)
|
41
|
+
rack (>= 1.0.0)
|
42
|
+
rack-test (>= 0.5.4)
|
43
|
+
selenium-webdriver (~> 2.0)
|
44
|
+
xpath (~> 1.0.0)
|
45
|
+
childprocess (0.3.9)
|
46
|
+
ffi (~> 1.0, >= 1.0.11)
|
47
|
+
coffee-rails (4.0.1)
|
48
|
+
coffee-script (>= 2.2.0)
|
49
|
+
railties (>= 4.0.0, < 5.0)
|
50
|
+
coffee-script (2.2.0)
|
51
|
+
coffee-script-source
|
52
|
+
execjs
|
53
|
+
coffee-script-source (1.6.3)
|
54
|
+
diff-lcs (1.2.4)
|
55
|
+
erubis (2.7.0)
|
56
|
+
execjs (2.0.2)
|
57
|
+
ffi (1.9.0)
|
58
|
+
generator_spec (0.9.0)
|
59
|
+
activerecord (>= 3.0, <= 4.0)
|
60
|
+
railties (>= 3.0, <= 4.0)
|
61
|
+
hike (1.2.3)
|
62
|
+
i18n (0.6.5)
|
63
|
+
jquery-rails (3.0.4)
|
64
|
+
railties (>= 3.0, < 5.0)
|
65
|
+
thor (>= 0.14, < 2.0)
|
66
|
+
mail (2.5.4)
|
67
|
+
mime-types (~> 1.16)
|
68
|
+
treetop (~> 1.4.8)
|
69
|
+
mime-types (1.25)
|
70
|
+
mini_portile (0.5.2)
|
71
|
+
minitest (4.7.5)
|
72
|
+
multi_json (1.8.2)
|
73
|
+
nokogiri (1.6.0)
|
74
|
+
mini_portile (~> 0.5.0)
|
75
|
+
polyglot (0.3.3)
|
76
|
+
rack (1.5.2)
|
77
|
+
rack-test (0.6.2)
|
78
|
+
rack (>= 1.0)
|
79
|
+
rails (4.0.0)
|
80
|
+
actionmailer (= 4.0.0)
|
81
|
+
actionpack (= 4.0.0)
|
82
|
+
activerecord (= 4.0.0)
|
83
|
+
activesupport (= 4.0.0)
|
84
|
+
bundler (>= 1.3.0, < 2.0)
|
85
|
+
railties (= 4.0.0)
|
86
|
+
sprockets-rails (~> 2.0.0)
|
87
|
+
railties (4.0.0)
|
88
|
+
actionpack (= 4.0.0)
|
89
|
+
activesupport (= 4.0.0)
|
90
|
+
rake (>= 0.8.7)
|
91
|
+
thor (>= 0.18.1, < 2.0)
|
92
|
+
rake (10.1.0)
|
93
|
+
rspec-core (2.14.6)
|
94
|
+
rspec-expectations (2.14.3)
|
95
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
96
|
+
rspec-mocks (2.14.4)
|
97
|
+
rspec-rails (2.14.0)
|
98
|
+
actionpack (>= 3.0)
|
99
|
+
activesupport (>= 3.0)
|
100
|
+
railties (>= 3.0)
|
101
|
+
rspec-core (~> 2.14.0)
|
102
|
+
rspec-expectations (~> 2.14.0)
|
103
|
+
rspec-mocks (~> 2.14.0)
|
104
|
+
rubyzip (1.0.0)
|
105
|
+
selenium-webdriver (2.37.0)
|
106
|
+
childprocess (>= 0.2.5)
|
107
|
+
multi_json (~> 1.0)
|
108
|
+
rubyzip (~> 1.0.0)
|
109
|
+
websocket (~> 1.0.4)
|
110
|
+
sprockets (2.10.0)
|
111
|
+
hike (~> 1.2)
|
112
|
+
multi_json (~> 1.0)
|
113
|
+
rack (~> 1.0)
|
114
|
+
tilt (~> 1.1, != 1.3.0)
|
115
|
+
sprockets-rails (2.0.1)
|
116
|
+
actionpack (>= 3.0)
|
117
|
+
activesupport (>= 3.0)
|
118
|
+
sprockets (~> 2.8)
|
119
|
+
thor (0.18.1)
|
120
|
+
thread_safe (0.1.3)
|
121
|
+
atomic
|
122
|
+
tilt (1.4.1)
|
123
|
+
treetop (1.4.15)
|
124
|
+
polyglot
|
125
|
+
polyglot (>= 0.3.1)
|
126
|
+
turbolinks (1.3.0)
|
127
|
+
coffee-rails
|
128
|
+
tzinfo (0.3.38)
|
129
|
+
websocket (1.0.7)
|
130
|
+
xpath (1.0.0)
|
131
|
+
nokogiri (~> 1.3)
|
132
|
+
|
133
|
+
PLATFORMS
|
134
|
+
ruby
|
135
|
+
|
136
|
+
DEPENDENCIES
|
137
|
+
capybara (~> 2.0.2)
|
138
|
+
coffee-rails
|
139
|
+
generator_spec (~> 0.9.0)
|
140
|
+
initjs!
|
141
|
+
jquery-rails
|
142
|
+
rspec-rails (~> 2.14.0)
|
143
|
+
turbolinks
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -2,62 +2,62 @@
|
|
2
2
|
|
3
3
|
Initjs is a RubyGem that helps your organize your javascript files using Rails' asset pipeline. Providing a simple and automatic way to execute your javascript for a specific page.
|
4
4
|
|
5
|
-
Works fine with Turbolinks
|
5
|
+
Works fine with Turbolinks and pjax.
|
6
6
|
|
7
7
|
|
8
8
|
## Javascript structure example
|
9
9
|
|
10
|
-
The structure you need follow is the same of your controller and actions on
|
11
|
-
You can use a namespace too.
|
10
|
+
The structure you need follow is the same of your controller and actions on your Rails application.
|
12
11
|
|
13
|
-
### Simple
|
12
|
+
### Simple objects
|
14
13
|
|
15
14
|
```coffee
|
16
|
-
# app/assets/javascripts/app_name/posts/new.js.coffee
|
17
15
|
AppName.Posts ?= {}
|
18
16
|
|
19
|
-
AppName.Posts.New =
|
20
|
-
|
17
|
+
AppName.Posts.New =
|
18
|
+
init: ->
|
19
|
+
# Javascript for the page "posts/new"
|
20
|
+
modules: -> []
|
21
21
|
```
|
22
22
|
```coffee
|
23
|
-
# app/assets/javascripts/app_name/posts/show.js.coffee
|
24
23
|
AppName.Posts ?= {}
|
25
24
|
|
26
|
-
AppName.Posts.Show =
|
27
|
-
|
25
|
+
AppName.Posts.Show =
|
26
|
+
init: ->
|
27
|
+
# Javascript for the page "posts/1"
|
28
|
+
modules: -> []
|
28
29
|
```
|
30
|
+
|
31
|
+
We support namespaces too:
|
32
|
+
|
29
33
|
```coffee
|
30
|
-
# app/assets/javascripts/app_name/blog/posts/show.js.coffee
|
31
34
|
AppName.Blog ?= {}
|
32
35
|
AppName.Blog.Posts ?= {}
|
33
36
|
|
34
|
-
AppName.Blog.Posts.Show =
|
35
|
-
|
37
|
+
AppName.Blog.Posts.Show =
|
38
|
+
init: ->
|
39
|
+
# Javascript for the page "blog/posts/1"
|
40
|
+
modules: -> []
|
36
41
|
```
|
37
42
|
|
38
|
-
|
43
|
+
Also you can use just a function, if you'll not use modules.
|
39
44
|
|
40
45
|
```coffee
|
41
|
-
# app/assets/javascripts/app_name/posts/new.js.coffee
|
42
46
|
AppName.Posts ?= {}
|
43
47
|
|
44
|
-
AppName.Posts.New =
|
48
|
+
AppName.Posts.New = ->
|
45
49
|
# Javascript for the page "posts/new"
|
46
50
|
```
|
47
|
-
```coffee
|
48
|
-
# app/assets/javascripts/app_name/posts/show.js.coffee
|
49
|
-
AppName.Posts ?= {}
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
```
|
52
|
+
### Using Backbone.js
|
53
|
+
|
54
54
|
```coffee
|
55
|
-
|
56
|
-
AppName.Blog ?= {}
|
57
|
-
AppName.Blog.Posts ?= {}
|
55
|
+
AppName.Posts ?= {}
|
58
56
|
|
59
|
-
AppName.
|
60
|
-
|
57
|
+
AppName.Posts.New =
|
58
|
+
init: Backbone.View.extend
|
59
|
+
# Javascript for the page "posts/new"
|
60
|
+
modules: -> []
|
61
61
|
```
|
62
62
|
|
63
63
|
## Requirements
|
@@ -79,41 +79,143 @@ Run the generator:
|
|
79
79
|
|
80
80
|
rails generate initjs:install
|
81
81
|
|
82
|
-
Make sure initjs generator has injected `//= require app_name/app_name.js` and `//= require init.js` to your Javascript manifest file (usually
|
82
|
+
Make sure initjs generator has injected `//= require app_name/app_name.js` and `//= require init.js` to your Javascript manifest file (usually in `app/assets/javascripts/application.js`).
|
83
83
|
|
84
84
|
|
85
85
|
## Usage
|
86
86
|
|
87
|
-
Include the Initjs tag in your application layout (usually
|
87
|
+
Include the Initjs tag in your application layout (usually in `app/view/layouts/application.html.erb`) right after the opening of the body tag.
|
88
88
|
|
89
89
|
```erb
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
<body>
|
91
|
+
<%= initjs_tag 'AppName' %>
|
92
|
+
…
|
93
|
+
</body>
|
94
94
|
```
|
95
95
|
|
96
|
-
|
96
|
+
Why this tag? This tag will add the informations about the controller and action that is been executed.
|
97
97
|
|
98
|
-
If you have a commom javascript that you need execute every page, you can put in `app/assets/javascripts/app_name/app_name.js.coffee`
|
99
98
|
|
100
|
-
|
99
|
+
### The app file
|
100
|
+
|
101
|
+
The app file is the main file for your application, you can set some configurations and put some common code that you need to run on each page. This app file is usually in `app/assets/javascripts/app_name/app_name.js.coffee`. See the default file below:
|
102
|
+
|
101
103
|
|
102
104
|
```coffee
|
103
105
|
#= require_self
|
104
106
|
#= require_tree .
|
105
107
|
|
106
108
|
window.AppName =
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
109
|
+
configs:
|
110
|
+
turbolinks: true # True to use initjs with Turbolinks by default.
|
111
|
+
pjax: false # True to use initjs with pjax by default.
|
112
|
+
respond_with: # To not use respond_with, just set false.
|
113
|
+
'Create': 'New' # Respond the Create action with the New.
|
114
|
+
'Update': 'Edit' # Respond the Update action with the Edit.
|
115
|
+
|
116
|
+
initPage: ->
|
117
|
+
# If you are using the Turbolinks and you need run a code only one time, put something here.
|
118
|
+
# if you're not using the turbolinks, there's no difference between init and initPage.
|
119
|
+
init: ->
|
120
|
+
# Something here. This is called in every page, with or without Turbolinks.
|
121
|
+
```
|
122
|
+
|
123
|
+
### Modules
|
124
|
+
|
125
|
+
How about code that we need over and over again? Initjs was a solution for that: Modules!
|
126
|
+
|
127
|
+
Modules is the solution to not repeat the same code in more than one place. We just create a function with the code that we need in more than one place and then in the view we need use it, we just say it.
|
128
|
+
|
129
|
+
#### Examples
|
130
|
+
|
131
|
+
```coffee
|
132
|
+
AppName.Tabs = ->
|
133
|
+
$('.tabs a').click ->
|
134
|
+
# do something when the link is clicked
|
135
|
+
```
|
136
|
+
|
137
|
+
```coffee
|
138
|
+
AppName.Posts.Show =
|
139
|
+
init:
|
140
|
+
|
141
|
+
modules: -> [AppName.Tabs]
|
142
|
+
```
|
143
|
+
|
144
|
+
This `AppName.Tabs` will be automatically called when you access `/posts/1` for example.
|
145
|
+
|
146
|
+
|
147
|
+
You also can declare modules for controller, namespaces and for the app, and even modules:
|
148
|
+
|
149
|
+
```coffee
|
150
|
+
AppName.Posts.modules = -> [AppName.Tabs]
|
151
|
+
```
|
152
|
+
|
153
|
+
This is saying to use the `AppName.Tabs` module on all pages that is on `posts` controller.
|
154
|
+
|
155
|
+
```coffee
|
156
|
+
AppName.Tabs =
|
157
|
+
init: ->
|
158
|
+
$('.tabs a').click ->
|
159
|
+
# do something when the link is clicked
|
160
|
+
modules: -> [AppName.SomeOtherModule]
|
161
|
+
```
|
162
|
+
|
163
|
+
|
164
|
+
To declare modules for entire the app, you can do it on the app file:
|
165
|
+
|
166
|
+
```coffee
|
167
|
+
window.AppName =
|
168
|
+
initPage: ->
|
169
|
+
# ...
|
170
|
+
|
171
|
+
# ...
|
172
|
+
|
173
|
+
modules: -> [AppName.Tabs]
|
174
|
+
```
|
175
|
+
|
176
|
+
### Partials
|
177
|
+
|
178
|
+
Sometimes we need execute a javascript for html that will be rendered from a request using ajax/pjax and then execute the javascript. Initjs give you support for that.
|
179
|
+
|
180
|
+
You will need add on your 'partial' the `initjs_tag` and say that is a partial:
|
181
|
+
|
182
|
+
```erb
|
183
|
+
<%= initjs_tag app_name: 'AppName', partial: true %>
|
184
|
+
```
|
185
|
+
|
186
|
+
Then you'll need call the Initjs initialize for the partial. Let's say we are using pjax to request the 'partial'.
|
187
|
+
|
188
|
+
```coffee
|
189
|
+
$('.pjax-content').on 'pjax:complete', ->
|
190
|
+
Initjs.initializePartial()
|
191
|
+
```
|
192
|
+
|
193
|
+
Then Initjs will execute the javascript for that 'partial'.
|
194
|
+
|
195
|
+
**Important:** Modules in controller, namespace and in the application will not be initialized on partials, only modules in the specific view. The `init` function on the app file will be called on partials.
|
196
|
+
|
197
|
+
|
198
|
+
### Respond with
|
199
|
+
|
200
|
+
Let's say we have a `form` for edit a post with validations on the back-end side. My action is `edit` and the javascript is write for that action. When I submit this form and get an error, the action that is executing is `update` and not `edit` anymore. So Initjs should call the `Posts.Update` right? Right! But I need the same code that `Posts.Edit` uses to be executed on `Posts.Update` and I should be able to do it without repeating the code. Since Initjs 2.0.0 we have this feature by default.
|
201
|
+
|
202
|
+
On the app file we have a configuration saying the default action that will be executed.
|
203
|
+
|
204
|
+
```coffee
|
205
|
+
window.AppName =
|
206
|
+
configs:
|
207
|
+
# ...
|
208
|
+
respond_with:
|
209
|
+
'Create': 'New' # Respond the Create action with the New.
|
210
|
+
'Update': 'Edit' # Respond the Update action with the Edit.
|
115
211
|
```
|
116
212
|
|
213
|
+
You can change these actions or add more if you need.
|
214
|
+
|
215
|
+
Also you can disable this feature if ypu don't need it, just set `false` to `respond_with` variable.
|
216
|
+
|
217
|
+
**Important:** Initjs will take a look to see if is there a function for the view first of executing the respond_with, if so, it will initialize the view and not the respond_with configured action.
|
218
|
+
|
117
219
|
## Recomended directory structure
|
118
220
|
|
119
221
|
Here is the app folder `app/assets/javascripts/app_name/`.
|
@@ -194,12 +296,56 @@ rails g initjs:add [namespace]/[controllers] [action_1] [action_2] ... [action_n
|
|
194
296
|
* /posts
|
195
297
|
* new.js.coffee
|
196
298
|
|
299
|
+
## Changelog
|
197
300
|
|
198
|
-
|
301
|
+
### 2.0.0
|
302
|
+
|
303
|
+
- Add support for objects instead of only fuctions
|
304
|
+
- Add support for modules
|
305
|
+
- Add support for configurations
|
306
|
+
- Add support for pjax
|
307
|
+
- Add support to initialize inside a partial (pjax friendly)
|
308
|
+
- Add support for respond_with
|
309
|
+
- Remove the default namespace Common on app file
|
310
|
+
- Remove the finish filter
|
311
|
+
- Lots of refactoring and improvements
|
312
|
+
|
313
|
+
### 1.0.1
|
314
|
+
|
315
|
+
- Remove the the necessity of pass app_name on initjs_tag
|
316
|
+
- Change from `=->` to `= ->` on generators
|
317
|
+
- Use `?= {}` instead of `if` statement
|
318
|
+
- Change `if` statement for Trubolinks
|
319
|
+
- Others minor fixes
|
320
|
+
|
321
|
+
### 1.0.0
|
322
|
+
|
323
|
+
- Add support for application name
|
324
|
+
- Add 'install' generator
|
325
|
+
- Add 'add' generator
|
326
|
+
- Improve the specs
|
327
|
+
|
328
|
+
### 0.1.3
|
329
|
+
|
330
|
+
- Add Rails 4 compatibility
|
331
|
+
|
332
|
+
### 0.1.2
|
199
333
|
|
200
|
-
|
334
|
+
- Solve bug on IE in addEventListener
|
201
335
|
|
202
|
-
|
336
|
+
### 0.1.1
|
337
|
+
|
338
|
+
- Add initPage support to work better with Turbolinks
|
339
|
+
|
340
|
+
### 0.1.0
|
341
|
+
|
342
|
+
- First release
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
## Development environment
|
347
|
+
|
348
|
+
Make sure you install `Ruby 2.0.0`.
|
203
349
|
|
204
350
|
Then just checkout the code, configure dependencies and run the tests:
|
205
351
|
|
@@ -207,13 +353,11 @@ Then just checkout the code, configure dependencies and run the tests:
|
|
207
353
|
|
208
354
|
`git clone git://github.com/josemarluedke/initjs.git`
|
209
355
|
|
210
|
-
2. Enter the repo directory
|
356
|
+
2. Enter the repo directory.
|
211
357
|
|
212
358
|
`cd initjs`
|
213
359
|
|
214
|
-
|
215
|
-
|
216
|
-
3. Install [Bundler](http://gembundler.com/) into our [RVM](https://rvm.io/):
|
360
|
+
3. Install [Bundler](http://gembundler.com/).
|
217
361
|
|
218
362
|
`gem install bundler`
|
219
363
|
|
@@ -223,13 +367,9 @@ Then just checkout the code, configure dependencies and run the tests:
|
|
223
367
|
|
224
368
|
### Running tests
|
225
369
|
|
226
|
-
1.
|
227
|
-
|
228
|
-
`cd spec/dummy/`
|
229
|
-
|
230
|
-
2. Run the rspec
|
370
|
+
1. Run the rspec
|
231
371
|
|
232
|
-
`
|
372
|
+
`rake spec`
|
233
373
|
|
234
374
|
## Contributing
|
235
375
|
|
@@ -241,10 +381,10 @@ Then just checkout the code, configure dependencies and run the tests:
|
|
241
381
|
|
242
382
|
## Thanks
|
243
383
|
|
244
|
-
I have thanks to @diogob, that is my inspiration for this gem and thanks for core of code ([gist:2321526](https://gist.github.com/2321526))
|
384
|
+
I have thanks to @diogob, that is my inspiration for this gem and thanks for core of code ([gist:2321526](https://gist.github.com/diogob/2321526/326c848e29406743c67fd040d4237ffe7ebcc6cd))
|
245
385
|
|
246
386
|
# License
|
247
387
|
|
248
388
|
Copyright (c) 2012-2013 Josemar Davi Luedke
|
249
389
|
|
250
|
-
Licensed under the MIT license
|
390
|
+
Licensed under the [MIT license](LICENSE).
|
data/Rakefile
CHANGED
data/initjs.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_development_dependency 'rspec-rails', '~> 2.14.0'
|
23
23
|
gem.add_development_dependency 'generator_spec', '~> 0.9.0'
|
24
24
|
gem.add_development_dependency 'capybara', '~> 2.0.2'
|
25
|
-
gem.add_development_dependency 'sqlite3'
|
26
25
|
gem.add_development_dependency 'jquery-rails'
|
27
26
|
gem.add_development_dependency 'coffee-rails'
|
28
27
|
gem.add_development_dependency 'turbolinks'
|