hash_rocket 0.3.2 → 0.3.3

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hash_rocket (0.3.1)
4
+ hash_rocket (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -48,10 +48,4 @@ Notes:
48
48
 
49
49
  This script will prompt you the files he cannot parse
50
50
  --> ERROR ON /path/to/the/problematic/file
51
- ## Contributing
52
51
 
53
- 1. Fork it
54
- 2. Create your feature branch (`git checkout -b my-new-feature`)
55
- 3. Commit your changes (`git commit -am 'Added some feature'`)
56
- 4. Push to the branch (`git push origin my-new-feature`)
57
- 5. Create new Pull Request
@@ -1,3 +1,3 @@
1
1
  module HashRocket
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/lib/hash_rocket.rb CHANGED
@@ -7,6 +7,7 @@ module HashRocket
7
7
  end
8
8
 
9
9
  def self.convert(folder=nil, path=nil, verbose=nil)
10
+ puts ".... #{path}"
10
11
  file_names = path_parameters(folder, path)
11
12
  file_names.each do |fn|
12
13
  if fn =~ /(Gemfile|\.(erb|rb|html|haml|spec))/
@@ -33,12 +34,17 @@ private
33
34
  end
34
35
 
35
36
  def self.solve_invalid_byte_sequence_in_utf8(text)
36
- text.encode!('UTF-16', undef: :replace, invalid: :replace, replace: "")
37
- return text.encode!('UTF-8')
37
+ if defined?(Rails)
38
+ text.encode!('UTF-16', undef: :replace, invalid: :replace, replace: "")
39
+ puts "mouahha1"
40
+ return text.encode!('UTF-8')
41
+ else
42
+ return text
43
+ end
38
44
  end
39
45
 
40
46
  def self.organize_symbols(text, verbose)
41
- result = text.scan(/([^:]:\w{1,}(\ {1,}|[\ {1,}]?)=>(\ {1,}|[\ ]?))/).flatten
47
+ result = text.scan(/([^:]:\w{1,}(\ {1,}|[\ {1,}]?)=>(\ {1,}|[\ ]?))|(^:\w{1,}(\ {1,}|[\ {1,}]?)=>(\ {1,}|[\ ]?))/).flatten
42
48
  text = match_symbols(text, result, verbose) if result
43
49
  text
44
50
  end
data/spec/data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/file.erb CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/file.haml CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/file.html CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/file.rb CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/file.yml CHANGED
@@ -1,3 +1,4 @@
1
+ :first_line => 'value'
1
2
  class Example
2
3
 
3
4
  def foo
@@ -19,6 +20,8 @@ class Example
19
20
  ,:class => 'value'
20
21
  (:cache => 'value'
21
22
  paginate:page => 'value'
23
+ :multiple=>'value',:symbol=>'value'
24
+ :multiple => 2,:symbol=>'value'
22
25
  end
23
26
 
24
27
  end
data/spec/data/result.txt CHANGED
@@ -1,3 +1,5 @@
1
+
2
+ first_line: 'value'
1
3
  class Example
2
4
 
3
5
  def foo
@@ -19,6 +21,8 @@ no_ident: 'value'
19
21
  , class: 'value'
20
22
  ( cache: 'value'
21
23
  paginate page: 'value'
24
+ multiple: 'value', symbol: 'value'
25
+ multiple: 2, symbol: 'value'
22
26
  end
23
27
 
24
28
  end
@@ -5,13 +5,14 @@ describe HashRocket do
5
5
  let(:folder) { File.expand_path('../..',__FILE__) + "/spec/data" }
6
6
  let(:result) { "/result.txt" }
7
7
 
8
- describe "hash_rocket should be replaced if the file extention is supported: " do
8
+ context "hash_rocket should be replaced if the file extention is supported: " do
9
9
 
10
10
  before :each do
11
11
  @file = folder + example.metadata[:file_ext]
12
12
  @backup = File.read(@file)
13
- HashRocket.convert(nil, @file, nil)
13
+ HashRocket.convert(nil, @file, true)
14
14
  @conversion = File.read(@file)
15
+ puts @conversion
15
16
  end
16
17
 
17
18
  after :each do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_rocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-08 00:00:00.000000000 Z
12
+ date: 2013-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70279171523180 !ruby/object:Gem::Requirement
16
+ requirement: &70201732751120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70279171523180
24
+ version_requirements: *70201732751120
25
25
  description: find and replace old hash rocket
26
26
  email:
27
27
  - mathieub@4nkh.com