js_erb 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +11 -3
- data/README.rdoc +10 -3
- data/lib/js_erb/controller.rb +1 -1
- data/lib/js_erb/version.rb +1 -1
- metadata +2 -5
data/CHANGELOG.rdoc
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
= JsErb - Changelog
|
2
2
|
|
3
|
-
== js_erb v0.1.
|
3
|
+
== js_erb v0.1.4 released 2010/11/09
|
4
4
|
|
5
5
|
* fixing bugs
|
6
6
|
|
7
|
-
== js_erb v0.1.
|
7
|
+
== js_erb v0.1.3 released 2010/11/07
|
8
|
+
|
9
|
+
* Updating i18n function (special keys support)
|
10
|
+
|
11
|
+
== js_erb v0.1.2 released 2010/11/05
|
12
|
+
|
13
|
+
* fixing bugs
|
14
|
+
|
15
|
+
== js_erb v0.1.1 released 2010/11/05
|
8
16
|
|
9
17
|
* fixing bugs
|
10
18
|
|
11
|
-
== js_erb v0.1.0 released 2010/05
|
19
|
+
== js_erb v0.1.0 released 2010/11/05
|
12
20
|
|
13
21
|
* initial release
|
14
22
|
|
data/README.rdoc
CHANGED
@@ -15,7 +15,7 @@ Add this line to your Gemfile
|
|
15
15
|
Move public/javascripts directory to app/javascripts. Files with *.jserb extension can contain
|
16
16
|
ERB-styled ruby code (e.g. <%= var %>).
|
17
17
|
|
18
|
-
Create a RAILS/config/locales/en.
|
18
|
+
Create a RAILS/config/locales/js/en.yml file
|
19
19
|
|
20
20
|
# Javascript translations
|
21
21
|
en:
|
@@ -28,7 +28,7 @@ Create a configuration file RAILS/config/js_erb.yml
|
|
28
28
|
views: app/views
|
29
29
|
source: app/javascripts
|
30
30
|
compiled: public/javascripts/compiled
|
31
|
-
locales: config/locales
|
31
|
+
locales: config/locales/js
|
32
32
|
|
33
33
|
# List of Haml, ERB or HTML files (base on path.source path)
|
34
34
|
views:
|
@@ -38,7 +38,14 @@ Create a configuration file RAILS/config/js_erb.yml
|
|
38
38
|
You have to change the views list of the configuration file. Note also you can use ruby code
|
39
39
|
inside the yml file (e.g. <%= var %>).
|
40
40
|
|
41
|
-
At the end set javascript_include_tag (add javascript files
|
41
|
+
At the end set javascript_include_tag method in your views (add all javascript files located at
|
42
|
+
public/javascripts/compiled into the <head>).
|
43
|
+
|
44
|
+
# Example of layout file (HAML)
|
45
|
+
%head
|
46
|
+
%title= 'My website'
|
47
|
+
%meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=utf-8" }
|
48
|
+
= javascript_include_tag 'compiled/locales/en.js', 'compiled/views/jserb.js', ...
|
42
49
|
|
43
50
|
== Javascript HTML Templates & Translations
|
44
51
|
|
data/lib/js_erb/controller.rb
CHANGED
@@ -52,7 +52,7 @@ module JsErb
|
|
52
52
|
# Renders config/locales.
|
53
53
|
#
|
54
54
|
def compile_locales
|
55
|
-
Dir.glob("#{JsErb.config['path']['locales']}/*.
|
55
|
+
Dir.glob("#{JsErb.config['path']['locales']}/*.yml").each do |file|
|
56
56
|
name = File.basename(file, '.js.yml')
|
57
57
|
content = YAML.load(ERB.new(File.read(file)).result)
|
58
58
|
File.open(File.join(JsErb.config['path']['compiled'], 'locales', "#{name}.js"), "wb") do |f|
|
data/lib/js_erb/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js_erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 29
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Kristijan Sedlak
|
@@ -55,7 +54,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
54
|
requirements:
|
56
55
|
- - ">="
|
57
56
|
- !ruby/object:Gem::Version
|
58
|
-
hash: 3
|
59
57
|
segments:
|
60
58
|
- 0
|
61
59
|
version: "0"
|
@@ -64,7 +62,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
62
|
requirements:
|
65
63
|
- - ">="
|
66
64
|
- !ruby/object:Gem::Version
|
67
|
-
hash: 3
|
68
65
|
segments:
|
69
66
|
- 0
|
70
67
|
version: "0"
|