erb_with_hash 0.0.2 → 0.1.0

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
- SHA1:
3
- metadata.gz: 7eb4632ed4d105d0b15c6f00bf12a9dfb11d9f66
4
- data.tar.gz: 3f9c83447be6335117d17d971ccc151544461b70
2
+ SHA256:
3
+ metadata.gz: c27d070a33e97f7496e4040e731042dcbe68955a9f3a0457fc22785ab1e76e9d
4
+ data.tar.gz: 8f2731979a85d6bb305f5be593a49890f598ba2dd7e50ddf4ddd965c40712bfd
5
5
  SHA512:
6
- metadata.gz: 35cdf681968d43696851495fccc3dd5c0f5fe5a7c67755511961a32a749469818764d7e48858a83a95b936f332e35a4f89b6b67660204360ad1934e491e1387f
7
- data.tar.gz: 1a77dda70664f88ca26c93198e8a5f1b78e30c9dd3035c02a0fcc27bc48915b950c09a38cb9b4d2287bc5185d7005805c519dd7ff5e3daf4a1f4475751a26ec6
6
+ metadata.gz: e3eb3c0c1cf9574a18c4c74968902947c50b833469d54ac8315a80292e5c9960ff35f1fd0c496d7249cb40f69535d8bb394a264fed7178be15037536b02ff136
7
+ data.tar.gz: c3675167401ee7ce6b9cb17632b05527b8a57a0a7aa5c4eaf9af52c1d46a5074bf66d057ea49fb6e1166449bf9895870f8952cd39522a4658e0e250b2e4eee04
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - 2.1.10
5
+ - 2.2.7
6
+ - 2.3.4
7
+ - 2.4.1
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ERBWithHash
2
2
 
3
+ [![Build Status](https://travis-ci.org/takkanm/erb_with_hash.svg&branch=master)](https://travis-ci.org/takkanm/erb_with_hash)
4
+
3
5
  allow Hash in ERB#result written by @seki.
4
6
 
5
7
  ## Installation
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task default: :spec
7
+ rescue LoadError
8
+ end
@@ -19,4 +19,5 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_development_dependency 'bundler', '~> 1.3'
21
21
  spec.add_development_dependency 'rake'
22
+ spec.add_development_dependency 'rspec'
22
23
  end
data/lib/erb_with_hash.rb CHANGED
@@ -37,6 +37,10 @@ end
37
37
 
38
38
  require 'erb'
39
39
 
40
- class ERB
41
- include ERBWithHash
40
+ unless ERB.public_method_defined?(:result_with_hash)
41
+ class ERB
42
+ include ERBWithHash
43
+ end
44
+ else
45
+ warn 'ERB#result_with_hash is already supported in original erb.'
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module ERBWithHash
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,13 @@
1
+ require_relative '../lib/erb_with_hash'
2
+
3
+ RSpec.describe ERBWithHash do
4
+ describe '#result_with_hash' do
5
+ let(:template) {
6
+ ERB.new "<% b = a + 1 %><%= a %> + 1 = <%= b %>"
7
+ }
8
+
9
+ subject { template.result_with_hash(a: 1) }
10
+
11
+ it { is_expected.to eq "1 + 1 = 2" }
12
+ end
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb_with_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masatoshi Seki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-29 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Arrow Hash in ERB#result
42
56
  email:
43
57
  executables: []
@@ -45,6 +59,7 @@ extensions: []
45
59
  extra_rdoc_files: []
46
60
  files:
47
61
  - ".gitignore"
62
+ - ".travis.yml"
48
63
  - Gemfile
49
64
  - LICENSE.txt
50
65
  - README.md
@@ -52,6 +67,7 @@ files:
52
67
  - erb_with_hash.gemspec
53
68
  - lib/erb_with_hash.rb
54
69
  - lib/erb_with_hash/version.rb
70
+ - spec/erb_with_hash_spec.rb
55
71
  homepage: https://github.com/takkanm/erb_with_hash
56
72
  licenses:
57
73
  - MIT
@@ -72,8 +88,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
88
  version: '0'
73
89
  requirements: []
74
90
  rubyforge_project:
75
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.6.14
76
92
  signing_key:
77
93
  specification_version: 4
78
94
  summary: Arrow Hash in ERB#result
79
- test_files: []
95
+ test_files:
96
+ - spec/erb_with_hash_spec.rb