haml-i18n-extractor 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,7 +8,7 @@ It doesn't translate already translated keys, or things it identfies that are no
8
8
 
9
9
  ## Usage
10
10
 
11
- You can use the binary which is an interactive prompting mode included in this library, or just use the code directly. See below for more examples.
11
+ You can use the binary which has an interactive (prompting) and non-interactive mode included in this library. You should be able to use the code directly as a lib too.
12
12
 
13
13
  ## Examples
14
14
 
@@ -29,22 +29,13 @@ end
29
29
 
30
30
  ## Demo using interactive mode
31
31
 
32
- Check out the quite brief movie/swf file demo of this lib's executable in `demo/` . You should be able to see it online here, considering your browser supports swf:
32
+ The demo is pretty outdated at this point. I would take it off the readme, but heck, I'm lazy. If you want a brief bad version of some of the stuff it does, since that video is pretty old, see it here (your browser needs to support swf):
33
33
 
34
34
  [Demo](http://shairosenfeld.com/haml-i18n-extractor-demo.swf)
35
35
 
36
- The demo will probably be outdated at some point, but the main idea holds. Some of the stuff not in there:
37
-
38
- - A "tag" functionality, which enables you to tag a line you want to review for later, if you are unsure you want to replace it. It will create a list of /file/path:42 tags for you to go and revisit later.
39
- - You can use "Next" if you're in the middle of processing a file and go to the next file.
40
- - Option parsing.
41
- - Other stuff that will come up.
42
-
43
- Have any other ideas? Let me know or better yet, submit a pull request.
44
-
45
36
  ## Example output
46
37
 
47
- This should be a before and after picture of using this lib, whether using the interactive mode or plain ruby.
38
+ This should be a before and after picture of using this lib, whether using the non-interactive/interactive mode. There are more examples in the tests where you can see more use cases being translated.
48
39
 
49
40
  - Before running (old haml):
50
41
 
@@ -127,7 +118,12 @@ If you want the latest code aka edge, you can also simply clone this repo and in
127
118
  ## Feedback
128
119
 
129
120
  Can use github issues to address any concern you have, or simply email me, with the contact info here: [http://shairosenfeld.com/](http://shairosenfeld.com/).
130
- You may find me on freenode #haml-i18n-extractor although I don't check it that often. Also on twitter you can find me with the same username as my GH one.
121
+
122
+ You can also find me on twitter with the same username as my GH one.
123
+
124
+ ## Have an idea or an issue?
125
+
126
+ Open an [issue](https://github.com/shaiguitar/haml-i18n-extractor/issues/new). Feeling like giving back? Contribute!
131
127
 
132
128
  ## Contributing
133
129
 
@@ -1,6 +1,7 @@
1
1
  require "trollop"
2
2
 
3
3
  require "haml-i18n-extractor/version"
4
+ require "haml-i18n-extractor/helpers"
4
5
 
5
6
  require "haml-i18n-extractor/extraction/text_finder"
6
7
  require "haml-i18n-extractor/extraction/exception_finder"
@@ -12,7 +13,7 @@ require "haml-i18n-extractor/extraction/haml_writer"
12
13
  require "haml-i18n-extractor/extraction/yaml_tool"
13
14
  require "haml-i18n-extractor/extraction/extractor"
14
15
 
15
- require "haml-i18n-extractor/flow/helpers"
16
+
16
17
  require "haml-i18n-extractor/flow/prompter"
17
18
  require "haml-i18n-extractor/flow/user_action"
18
19
  require "haml-i18n-extractor/flow/workflow"
@@ -3,7 +3,7 @@ module Haml
3
3
  class Extractor
4
4
 
5
5
  def self.debug?
6
- ENV['DEBUG']
6
+ ENV['DEBUG_EXTRACTOR']
7
7
  end
8
8
 
9
9
  # helpful for debugging
@@ -5,31 +5,30 @@ module Haml
5
5
  class Extractor
6
6
  class TextFinder
7
7
 
8
+ include Helpers::StringHelpers
9
+
10
+ # if any of the private handler methods return nil the extractor just outputs orig_line and keeps on going.
11
+ # if there's an empty string that should do the trick to ( ExceptionFinder can return no match that way )
8
12
  def initialize(orig_line,line_metadata)
9
13
  @orig_line = orig_line
10
14
  @metadata = line_metadata
11
15
  end
12
16
 
13
- # returns [ line_type, text_found ]
14
17
  def process_by_regex
18
+ # [ line_type, text_found ]
15
19
  if Haml::I18n::Extractor.debug?
16
- binding.pry
17
- puts '!!!'
18
20
  puts @metadata && @metadata[:type]
21
+ puts @metadata.inspect
19
22
  puts @orig_line
20
23
  end
21
- # if any of the handler methods return nil the extractor just outputs orig_line and keeps on going.
22
- # if there's an empty string that should do the trick to ( ExceptionFinder can return no match that way )
23
24
  @metadata && send("#{@metadata[:type]}", @metadata)
24
25
  end
25
26
 
26
27
  private
27
28
 
28
- #FIXME move all these matches into a helper of some sort.
29
-
30
29
  def plain(line)
31
30
  txt = line[:value][:text]
32
- return nil if txt.match(/<!--/) || txt.match(/-->\s*$/) # ignore html comments
31
+ return nil if html_comment?(txt)
33
32
  [:plain, txt]
34
33
  end
35
34
 
@@ -37,7 +36,7 @@ module Haml
37
36
  txt = line[:value][:value]
38
37
  if txt
39
38
  has_script_in_tag = line[:value][:parse] # %element= foo
40
- has_exception = txt.match(/link_to/) || txt.match(/^\s*['"]/) # %element= 'foo'
39
+ has_exception = link_to?(txt)
41
40
  if has_script_in_tag && !has_exception
42
41
  [:tag, ""]
43
42
  else
@@ -50,9 +49,7 @@ module Haml
50
49
 
51
50
  def script(line)
52
51
  txt = line[:value][:text]
53
- scanner = StringScanner.new(txt)
54
- scanner.scan(/\s+/)
55
- if scanner.scan(/['"]/) || scanner.scan(/link_to/)
52
+ if could_match_script?(txt)
56
53
  [:script, ExceptionFinder.new(txt).find]
57
54
  else
58
55
  [:script, ""]
@@ -23,7 +23,8 @@ module Haml
23
23
  end
24
24
 
25
25
  def replace_hash
26
- @replace_hash ||= { :modified_line => modified_line, :keyname => keyname, :replaced_text => @text_to_replace }
26
+ t_name = keyname(@text_to_replace, @orig_line)
27
+ @replace_hash ||= { :modified_line => modified_line, :keyname => t_name, :replaced_text => @text_to_replace }
27
28
  end
28
29
 
29
30
  # the new full line, including a `t()` replacement instead of the `text_to_replace` portion.
@@ -37,24 +38,35 @@ module Haml
37
38
 
38
39
  private
39
40
 
40
- def keyname
41
- text_to_replace = @text_to_replace.dup
41
+ def keyname(to_replace, orig_line)
42
+ text_to_replace = to_replace.dup
42
43
  if has_been_translated?(text_to_replace)
43
44
  text_to_replace
44
45
  else
45
- name = to_keyname(text_to_replace)
46
- name = to_keyname(@orig_line.dup) if name.empty?
47
- "t('.#{name}')"
46
+ name = normalize_name(text_to_replace)
47
+ name = normalize_name(orig_line.dup) if name.empty?
48
+ with_translate_method(name)
48
49
  end
49
50
  end
50
51
 
52
+ def with_translate_method(name)
53
+ "t('.#{name}')"
54
+ end
55
+
51
56
  # adds the = to the right place in the string ... = t() stuff.
52
57
  def apply_ruby_evaling(str)
53
58
  if LINE_TYPES_ADD_EVAL.include?(@line_type)
54
59
  if @line_type == :tag
55
- str.match /^([^\s\t]*)(.*)$/
56
- elem, keyname = $1, $2
57
- str.gsub!($2, "= #{$2.strip}") unless already_evaled?(elem)
60
+ #str.match /^([^\s\t]*)(.*)$/
61
+ t_name = keyname(@text_to_replace, @orig_line)
62
+ match_keyname = Regexp.new('[\s\t]*' + Regexp.escape(t_name))
63
+ str.match(/(.*?)(#{match_keyname})/)
64
+ elem = $1
65
+ #binding.pry if str.match /color/
66
+ #str.gsub!(keyname, "= #{keyname.strip}")
67
+ if elem
68
+ str.gsub!(Regexp.new(Regexp.escape(elem)), "#{elem}=") unless already_evaled?(elem)
69
+ end
58
70
  elsif @line_type == :plain
59
71
  str.gsub!(str, "= "+str)
60
72
  end
@@ -73,14 +85,15 @@ module Haml
73
85
 
74
86
  def remove_surrounding_quotes(str)
75
87
  # if there are quotes surrounding the string, we want them removed as well...
76
- unless str.gsub!('"' + @text_to_replace + '"', keyname)
77
- unless str.gsub!("'" + @text_to_replace + "'", keyname)
78
- str.gsub!(@text_to_replace, keyname)
88
+ t_name = keyname(@text_to_replace, @orig_line)
89
+ unless str.gsub!('"' + @text_to_replace + '"', t_name )
90
+ unless str.gsub!("'" + @text_to_replace + "'", t_name)
91
+ str.gsub!(@text_to_replace, t_name)
79
92
  end
80
93
  end
81
94
  end
82
95
 
83
- def to_keyname(str)
96
+ def normalize_name(str)
84
97
  NOT_ALLOWED_IN_KEYNAME.each{ |rm_me| str.gsub!(rm_me, "") }
85
98
  str = str.gsub(/\s+/, " ").strip
86
99
  str.downcase.tr(' ', '_')[0..LIMIT_KEY_NAME-1]
@@ -0,0 +1,37 @@
1
+ module Haml
2
+ module I18n
3
+ class Extractor
4
+ module Helpers
5
+
6
+ module StringHelpers
7
+ def html_comment?(txt)
8
+ txt.match(/<!--/) || txt.match(/-->\s*$/)
9
+ end
10
+ def link_to?(txt)
11
+ txt.match(/link_to/) || txt.match(/^\s*['"]/) # %element= 'foo'
12
+ end
13
+
14
+ def could_match_script?(txt)
15
+ # want to match:
16
+ # = 'foo'
17
+ # = "foo"
18
+ # = link_to 'bla'
19
+ #
20
+ # but not match:
21
+ # = ruby_var = 2
22
+ scanner = StringScanner.new(txt)
23
+ scanner.scan(/\s+/)
24
+ scanner.scan(/['"]/) || scanner.scan(/link_to/)
25
+ end
26
+ end
27
+
28
+ module Highline
29
+ def highlight(str, color = :yellow)
30
+ "<%= color('#{str.to_s}', :black, :on_#{color}) %>"
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+
@@ -1,7 +1,7 @@
1
1
  module Haml
2
2
  module I18n
3
3
  class Extractor
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
6
6
  end
7
7
  end
@@ -97,29 +97,6 @@ module Haml
97
97
  end
98
98
  end
99
99
 
100
- # really integration tests...movez.
101
- test "it can replace a string body and have expected output ex4" do
102
- expected_output = File.read(file_path("ex4.output.haml"))
103
- assert_equal Haml::I18n::Extractor.new(file_path("ex4.haml")).new_body, expected_output
104
- end
105
-
106
- test "it can replace a string body and have expected output ex3" do
107
- expected_output = File.read(file_path("ex3.output.haml"))
108
- assert_equal Haml::I18n::Extractor.new(file_path("ex3.haml")).new_body, expected_output
109
- end
110
-
111
- test "it can replace a string body and have expected output ex2" do
112
- expected_output = File.read(file_path("ex2.output.haml"))
113
- assert_equal Haml::I18n::Extractor.new(file_path("ex2.haml")).new_body, expected_output
114
- end
115
-
116
-
117
- test "it can replace a string body and have expected output ex1" do
118
- expected_output = File.read(file_path("ex1.output.haml"))
119
- assert_equal @ex1.new_body, expected_output
120
- end
121
-
122
-
123
100
  test "it writes the haml to an out file if valid haml output" do
124
101
  FileUtils.rm_rf(@ex1.haml_writer.path)
125
102
  assert_equal File.exists?(@ex1.haml_writer.path), false
@@ -1,3 +1,5 @@
1
+ require 'test_helper'
2
+
1
3
  module Haml
2
4
  class IntegrationTest < MiniTest::Unit::TestCase
3
5
 
@@ -20,5 +22,30 @@ module Haml
20
22
  assert partial_extractor.yaml_tool.yaml_hash["en"]["view2"]["partial"], "partial filenames in yaml are w/out leading _"
21
23
  end
22
24
 
25
+ ## EXAMPLES
26
+
27
+ test "it can replace a string body and have expected output ex4" do
28
+ expected_output = File.read(file_path("ex4.output.haml"))
29
+ assert_equal Haml::I18n::Extractor.new(file_path("ex4.haml")).new_body, expected_output
30
+ end
31
+
32
+ test "it can replace a string body and have expected output ex3" do
33
+ expected_output = File.read(file_path("ex3.output.haml"))
34
+ assert_equal Haml::I18n::Extractor.new(file_path("ex3.haml")).new_body, expected_output
35
+ end
36
+
37
+ test "it can replace a string body and have expected output ex2" do
38
+ expected_output = File.read(file_path("ex2.output.haml"))
39
+ assert_equal Haml::I18n::Extractor.new(file_path("ex2.haml")).new_body, expected_output
40
+ end
41
+
42
+
43
+ test "it can replace a string body and have expected output ex1" do
44
+ expected_output = File.read(file_path("ex1.output.haml"))
45
+ assert_equal Haml::I18n::Extractor.new(file_path("ex1.haml")).new_body, expected_output
46
+ end
47
+
48
+
49
+
23
50
  end
24
51
  end
@@ -4,7 +4,7 @@
4
4
  = link_to t('.real_text_here'), id: 'customer-control-menu', role: 'button', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do
5
5
  = t('.there')
6
6
 
7
- %span.creator{:title= => "This user is an t('.owner') of this account"} t('.owner')
7
+ %span.creator{:title => "This user is an= t('.owner') of this account"} t('.owner')
8
8
  %span.title&= user.name
9
9
  %strong \#{@account.name}
10
10
 
@@ -7,6 +7,7 @@ html comments what
7
7
  var bar = foo;
8
8
  More
9
9
  And More
10
+ %h2{:style=>'font-size: 1em; color: #fff; font-weight: normal; text-align: center; margin-bottom:20px;'} Some text
10
11
  .class This is text
11
12
  - if true
12
13
  :javascript
@@ -7,6 +7,7 @@
7
7
  var bar = foo;
8
8
  = t('.more')
9
9
  = t('.and_more')
10
+ %h2{:style=>'font-size: 1em; color: #fff; font-weight: normal; text-align: center; margin-bottom:20px;'}= t('.some_text')
10
11
  .class= t('.this_is_text')
11
12
  - if true
12
13
  :javascript
metadata CHANGED
@@ -1,205 +1,216 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: haml-i18n-extractor
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 3
10
+ version: 0.4.3
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Shai Rosenfeld
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2013-09-03 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-09-05 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
14
21
  name: tilt
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
22
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: haml
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
34
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: haml
35
36
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: activesupport
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
48
46
  type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: activesupport
49
50
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: highline
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
62
60
  type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: highline
63
64
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: trollop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 1.16.2
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
76
74
  type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: trollop
77
78
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - "="
83
+ - !ruby/object:Gem::Version
84
+ hash: 83
85
+ segments:
86
+ - 1
87
+ - 16
88
+ - 2
82
89
  version: 1.16.2
83
- - !ruby/object:Gem::Dependency
90
+ type: :runtime
91
+ version_requirements: *id005
92
+ - !ruby/object:Gem::Dependency
84
93
  name: rbench
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ! '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
94
  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: m
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ! '>='
102
- - !ruby/object:Gem::Version
103
- version: '0'
95
+ requirement: &id006 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
104
  type: :development
105
+ version_requirements: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ name: m
105
108
  prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: pry
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ! '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
109
+ requirement: &id007 !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
118
118
  type: :development
119
+ version_requirements: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ name: pry
119
122
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ! '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: minitest
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ! '>='
130
- - !ruby/object:Gem::Version
131
- version: '0'
123
+ requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 0
131
+ version: "0"
132
132
  type: :development
133
+ version_requirements: *id008
134
+ - !ruby/object:Gem::Dependency
135
+ name: minitest
133
136
  prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ! '>='
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: nokogiri
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ! '>='
144
- - !ruby/object:Gem::Version
145
- version: '0'
137
+ requirement: &id009 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 3
143
+ segments:
144
+ - 0
145
+ version: "0"
146
146
  type: :development
147
+ version_requirements: *id009
148
+ - !ruby/object:Gem::Dependency
149
+ name: nokogiri
147
150
  prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ! '>='
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: rake
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ! '>='
158
- - !ruby/object:Gem::Version
159
- version: '0'
151
+ requirement: &id010 !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ hash: 3
157
+ segments:
158
+ - 0
159
+ version: "0"
160
160
  type: :development
161
+ version_requirements: *id010
162
+ - !ruby/object:Gem::Dependency
163
+ name: rake
161
164
  prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ! '>='
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: actionpack
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: '0'
165
+ requirement: &id011 !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 3
171
+ segments:
172
+ - 0
173
+ version: "0"
174
174
  type: :development
175
+ version_requirements: *id011
176
+ - !ruby/object:Gem::Dependency
177
+ name: actionpack
175
178
  prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ! '>='
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: rails
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ! '>='
186
- - !ruby/object:Gem::Version
187
- version: '0'
179
+ requirement: &id012 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ hash: 3
185
+ segments:
186
+ - 0
187
+ version: "0"
188
188
  type: :development
189
+ version_requirements: *id012
190
+ - !ruby/object:Gem::Dependency
191
+ name: rails
189
192
  prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ! '>='
193
- - !ruby/object:Gem::Version
194
- version: '0'
193
+ requirement: &id013 !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ hash: 3
199
+ segments:
200
+ - 0
201
+ version: "0"
202
+ type: :development
203
+ version_requirements: *id013
195
204
  description: Parse the texts out of the haml files into localization files
196
- email:
205
+ email:
197
206
  - shaiguitar@gmail.com
198
- executables:
207
+ executables:
199
208
  - haml-i18n-extractor
200
209
  extensions: []
210
+
201
211
  extra_rdoc_files: []
202
- files:
212
+
213
+ files:
203
214
  - .gitignore
204
215
  - .rvmrc
205
216
  - Gemfile
@@ -222,10 +233,10 @@ files:
222
233
  - lib/haml-i18n-extractor/extraction/text_replacer.rb
223
234
  - lib/haml-i18n-extractor/extraction/yaml_tool.rb
224
235
  - lib/haml-i18n-extractor/flow/cli.rb
225
- - lib/haml-i18n-extractor/flow/helpers.rb
226
236
  - lib/haml-i18n-extractor/flow/prompter.rb
227
237
  - lib/haml-i18n-extractor/flow/user_action.rb
228
238
  - lib/haml-i18n-extractor/flow/workflow.rb
239
+ - lib/haml-i18n-extractor/helpers.rb
229
240
  - lib/haml-i18n-extractor/version.rb
230
241
  - test/cli_test.rb
231
242
  - test/exception_finder_test.rb
@@ -253,30 +264,39 @@ files:
253
264
  - test/workflow_test.rb
254
265
  - test/yaml_tool_test.rb
255
266
  homepage: https://github.com/shaiguitar/haml-i18n-extractor
256
- licenses:
267
+ licenses:
257
268
  - MIT
258
- metadata: {}
259
269
  post_install_message:
260
270
  rdoc_options: []
261
- require_paths:
271
+
272
+ require_paths:
262
273
  - lib
263
- required_ruby_version: !ruby/object:Gem::Requirement
264
- requirements:
265
- - - ! '>='
266
- - !ruby/object:Gem::Version
267
- version: '0'
268
- required_rubygems_version: !ruby/object:Gem::Requirement
269
- requirements:
270
- - - ! '>='
271
- - !ruby/object:Gem::Version
272
- version: '0'
274
+ required_ruby_version: !ruby/object:Gem::Requirement
275
+ none: false
276
+ requirements:
277
+ - - ">="
278
+ - !ruby/object:Gem::Version
279
+ hash: 3
280
+ segments:
281
+ - 0
282
+ version: "0"
283
+ required_rubygems_version: !ruby/object:Gem::Requirement
284
+ none: false
285
+ requirements:
286
+ - - ">="
287
+ - !ruby/object:Gem::Version
288
+ hash: 3
289
+ segments:
290
+ - 0
291
+ version: "0"
273
292
  requirements: []
293
+
274
294
  rubyforge_project:
275
- rubygems_version: 2.0.3
295
+ rubygems_version: 1.8.25
276
296
  signing_key:
277
- specification_version: 4
297
+ specification_version: 3
278
298
  summary: Parse the texts out of the haml files into localization files
279
- test_files:
299
+ test_files:
280
300
  - test/cli_test.rb
281
301
  - test/exception_finder_test.rb
282
302
  - test/extractor_test.rb
@@ -302,4 +322,3 @@ test_files:
302
322
  - test/text_replacer_test.rb
303
323
  - test/workflow_test.rb
304
324
  - test/yaml_tool_test.rb
305
- has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjljMTFjNmFiZDk2YWY2MjVlMWFmMjQwNDQ1MDc3OTdhYWRhNDlkZA==
5
- data.tar.gz: !binary |-
6
- NjlhYjM5YWFlOWY5NzNmM2E0ZjZjZGMwYWU5MDVlMWQ4YjU1MjYwNg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MDEzZDk1ODEzYzI1MjM4OTMwM2MwNWYzMTYzN2RjZDA2NjY5NmYwMGRmYjk5
10
- Yzc4MjViYjEyNThmYzJkOTNlZThlMDRmOTZmNmFiNjllNzM1NGQ4MWE2YmFj
11
- MjNlNjlmZDE4N2JiYTlmYTk2YTM4NDIwZDBmYmJmMzJkYmQwYjU=
12
- data.tar.gz: !binary |-
13
- ODMzNmU2NThmOTMxNDFhMTgwN2M4NzNhZGI4MmYyN2RiMmQ3NTEzMzNlM2Nk
14
- NGEzYmQ0ZjVjMTJmYmQ1OWNiZDUwNWMzMmIxOWMzYzM2ZGU1YTQ3ZjdlZTZl
15
- ZGU5MmUxZmIxYjU3YTQwOWNjZjQ3NzdmMDFlMmNlMzllMWY1Yzg=
@@ -1,16 +0,0 @@
1
- module Haml
2
- module I18n
3
- class Extractor
4
- module Helpers
5
- module Highline
6
-
7
- def highlight(str, color = :yellow)
8
- "<%= color('#{str.to_s}', :black, :on_#{color}) %>"
9
- end
10
-
11
- end
12
- end
13
- end
14
- end
15
- end
16
-