deface 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 487b1542ffc97468f5439e59d060cc202aab5abd
4
- data.tar.gz: 75bdffce97e44af4b4aa9ad9508e3dd3ddc511db
3
+ metadata.gz: 97ffccb90e6da94c30f13a7e7fa0ff5cb58b46e0
4
+ data.tar.gz: 53c04295d2d4ce3d84247cd92a235c65aae26463
5
5
  SHA512:
6
- metadata.gz: 01f69f5e73e800cd1bdbc1b3bffb098d0761aaffaaae4562240c92103d042b3c086bfddf2d05bf9504fc8f92a437d8ace506c3ba67d4ecdc224648377c4575e5
7
- data.tar.gz: 2cf5fbe8ca29078d6427454ee55f8c71e8a30cb40a1e6586327df4dfcc42508645a633f057fee6af522d10105d0984e74f6bf00c896ed690137d54e3bb5522ec
6
+ metadata.gz: 25ae8cc02921a14f84262ee46bfb5e940314e652abd05bfc72a87c403471039fe83326d4a7ef3869e3fd1994654fb109492f71f5b8baa46558e8f850a499c0af
7
+ data.tar.gz: bc8523db0265c48f27a56ca31a82893c82ccb029e70098255d80a6f911438ab5241d5f0022118fcc156c9e43b4b030e7da737f1ccfb51676ce8ac77d58a9802e
data/Gemfile CHANGED
@@ -2,4 +2,9 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', ENV['RAILS'] || '~> 3.2.13'
4
4
 
5
+ group :test do
6
+ gem "pry"
7
+ gem "pry-byebug"
8
+ end
9
+
5
10
  gemspec
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "deface"
3
- s.version = "1.0.0"
3
+ s.version = "1.0.1"
4
4
 
5
5
  s.authors = ["Brian D Quinn"]
6
6
  s.description = "Deface is a library that allows you to customize ERB, Haml and Slim views in a Rails application without editing the underlying view."
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency('nokogiri', '~> 1.6.0')
19
19
  s.add_dependency('rails', '>= 3.1')
20
20
  s.add_dependency('colorize', '>= 0.5.8')
21
+ s.add_dependency('polyglot')
21
22
 
22
23
  s.add_development_dependency('rspec', '>= 2.11.0')
23
24
  s.add_development_dependency('haml', '>= 3.1.4')
@@ -9,6 +9,8 @@ module Deface
9
9
 
10
10
  # logs if original source has changed
11
11
  def validate_original(match)
12
+ match = match.map(&:to_s).join if match.is_a? Array
13
+
12
14
  hashed_original = Digest::SHA1.hexdigest(match.to_s.gsub(/\s/, ''))
13
15
 
14
16
  if @args[:original].present?
@@ -64,17 +64,32 @@ module Deface
64
64
 
65
65
  it "should return true when input contains similar (ignoring whitespace)" do
66
66
  if RUBY_PLATFORM == 'java'
67
- @original.validate_original("<p><erb loud=\"\"> something </erb></p>").should be_true
68
- @original.validate_original("<p><erb loud=\"\">something\n</erb> </p>").should be_true
67
+ expect( @original.validate_original("<p><erb loud=\"\"> something </erb></p>") ).to eql true
68
+ expect( @original.validate_original("<p><erb loud=\"\">something\n</erb> </p>") ).to eql true
69
69
  else
70
- @original.validate_original("<p><erb loud> something </erb></p>").should be_true
71
- @original.validate_original("<p><erb loud>something\n</erb> </p>").should be_true
70
+ expect( @original.validate_original("<p><erb loud> something </erb></p>") ).to eql true
71
+ expect( @original.validate_original("<p><erb loud>something\n</erb> </p>") ).to eql true
72
+ end
73
+ end
74
+
75
+ it "should return true when input is an array" do
76
+ if RUBY_PLATFORM == 'java'
77
+ expect( @original.validate_original(["<p><erb loud=\"\"> something ","</erb></p>"]) ).to eql true
78
+ expect( @original.validate_original(["<p><erb loud=\"\">something\n","</erb> </p>"]) ).to eql true
79
+ else
80
+ expect( @original.validate_original(["<p><erb loud> something"," </erb></p>"]) ).to eql true
81
+ expect( @original.validate_original(["<p><erb loud>something\n","</erb> </p>"]) ).to eql true
72
82
  end
73
83
  end
74
84
 
75
85
  it "should return false when and input contains different string" do
76
- @original.validate_original("wrong").should be_false
86
+ expect( @original.validate_original("wrong") ).to eql false
87
+ end
88
+
89
+ it "should return false with input being an array and is a different string" do
90
+ expect( @original.validate_original(["wrong", "again"]) ).to eql false
77
91
  end
92
+
78
93
  end
79
94
 
80
95
 
@@ -385,7 +400,7 @@ module Deface
385
400
  end
386
401
 
387
402
  it "should remove old action" do
388
- @replacement.args.has_key?(:replace).should be_false
403
+ expect( @replacement.args.has_key?(:replace)).to eql false
389
404
  end
390
405
 
391
406
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deface
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian D Quinn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.5.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: polyglot
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -252,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
266
  version: '0'
253
267
  requirements: []
254
268
  rubyforge_project:
255
- rubygems_version: 2.1.0
269
+ rubygems_version: 2.0.14
256
270
  signing_key:
257
271
  specification_version: 4
258
272
  summary: Deface is a library that allows you to customize ERB, Haml and Slim views
@@ -295,3 +309,4 @@ test_files:
295
309
  - spec/deface/utils/failure_finder_spec.rb
296
310
  - spec/generators/deface/override_generator_spec.rb
297
311
  - spec/spec_helper.rb
312
+ has_rdoc: