hash_rocket 0.3.1 → 0.3.2

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.0)
4
+ hash_rocket (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module HashRocket
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/hash_rocket.rb CHANGED
@@ -48,12 +48,21 @@ private
48
48
  unless str.blank?
49
49
  puts str if verbose
50
50
  start, garbage, symbol, hash_rocket = str.match(/((^.{1,}:)|:)(.+)((\ {1,}|[\ {1,}]?)=>(\ {1,}|[\ ]?))/).captures
51
- space = start.gsub(":","")
52
- text = text.gsub(str, (space == "" ? "\n": space) + symbol.gsub(/\ /, "") + ": ")
51
+ space = return_space(start.gsub(":",""))
52
+ text = text.gsub(str, space + symbol.gsub(/\ /, "") + ": ")
53
53
  end
54
54
  end
55
55
  text
56
56
  end
57
-
58
- private_class_method :path_parameters, :retreive_file, :solve_invalid_byte_sequence_in_utf8, :organize_symbols, :match_symbols
57
+
58
+ def self.return_space(data)
59
+ if data == ""
60
+ "\n"
61
+ elsif data != " "
62
+ data + " "
63
+ else
64
+ data
65
+ end
66
+ end
67
+ private_class_method :path_parameters, :retreive_file, :solve_invalid_byte_sequence_in_utf8, :organize_symbols, :match_symbols, :return_space
59
68
  end
data/spec/data/Gemfile CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/file.erb CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/file.haml CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/file.html CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/file.rb CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/file.yml CHANGED
@@ -18,6 +18,7 @@ class Example
18
18
  :hash_end => {'value'
19
19
  ,:class => 'value'
20
20
  (:cache => 'value'
21
+ paginate:page => 'value'
21
22
  end
22
23
 
23
24
  end
data/spec/data/result.txt CHANGED
@@ -14,10 +14,11 @@ no_ident: 'value'
14
14
  left_double_space: 'value'
15
15
  right_double_space: 'value'
16
16
  _begin_with_under_score: 'value'
17
- {hash_start: 'value'
17
+ { hash_start: 'value'
18
18
  hash_end: {'value'
19
- ,class: 'value'
20
- (cache: 'value'
19
+ , class: 'value'
20
+ ( cache: 'value'
21
+ paginate page: 'value'
21
22
  end
22
23
 
23
24
  end
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.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70188247462840 !ruby/object:Gem::Requirement
16
+ requirement: &70279171523180 !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: *70188247462840
24
+ version_requirements: *70279171523180
25
25
  description: find and replace old hash rocket
26
26
  email:
27
27
  - mathieub@4nkh.com