rouge-rails 0.1.1 → 0.2.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: 0cb13feb7348227089d8f501320ae323c8190bd5
4
- data.tar.gz: 79bd66b510963d48dd23d9fb649bc574951104aa
3
+ metadata.gz: 330227a9302c0125a8809094d307358661c4e106
4
+ data.tar.gz: 8dcba00c5852d9dcdf121d210ccfa8fa0a1cfce5
5
5
  SHA512:
6
- metadata.gz: 1c6f1e9fd2cac0fa5bb0c627a2fbf5f92d9eff45569fea67392f9774c7b9e0cfd7c4ed4023c96657d68304d0f3dcf5a9652e9fdd042fbb044eb7a8031d488423
7
- data.tar.gz: d3c8f91a93ec4900ac10be09d3ffd68da74787f5e11c87f0abb43931f66d024463562aa931bdb3934c1bc49add4bd15a1cfecb88914bd74af013d729f0601d7f
6
+ metadata.gz: 6e333ca3276e31cdfcd19a3a34977314b2820e5ba2d45065b6d78168f15213bf70165ae2c8e461e2131b94a92330088f0ea9355845d2e3689c6d39a1e86f0f6d
7
+ data.tar.gz: 6c0c5d4bcffb07f7a37b36c34bcf35fca601ed4e4719decbf0ea77ae380faebc8bf0225f5fed0770bc943e2107082ae541e2f6eb1ce31caf0cc9d180041c9372
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ spec/dummy/log
11
+ spec/dummy/tmp
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Rouge::Rails
2
2
 
3
+ Give rails the power to render code samples in [rouge][rouge] colored glory.
4
+
3
5
  ## Installation
4
6
 
5
7
  Add this line to your application's Gemfile:
@@ -86,3 +88,5 @@ https://github.com/jacobsimeon/rouge-rails.
86
88
  The gem is available as open source under the terms of the [MIT
87
89
  License](http://opensource.org/licenses/MIT).
88
90
 
91
+
92
+ [rouge]: https://github.com/jneen/rouge
@@ -35,11 +35,20 @@ module Rouge::Rails
35
35
  end
36
36
 
37
37
  def source
38
- template.source.inspect
38
+ "begin; #{erb_handler.call(template)} end"
39
39
  end
40
40
 
41
41
  def default_lexer
42
42
  "Rouge::Lexers::PlainText"
43
43
  end
44
+
45
+ def self.erb_handler
46
+ @erb_handler ||= ActionView::Template.handler_for_extension(:erb)
47
+ end
48
+
49
+ def erb_handler
50
+ self.class.erb_handler
51
+ end
52
+
44
53
  end
45
54
  end
@@ -1,5 +1,5 @@
1
1
  module Rouge
2
2
  module Rails
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
data/rouge-rails.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  spec.add_development_dependency "pry"
28
+ spec.add_development_dependency "capybara"
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Morris
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-22 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: capybara
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description:
112
126
  email:
113
127
  - jacob.s.morris@gmail.com
@@ -176,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
190
  version: '0'
177
191
  requirements: []
178
192
  rubyforge_project:
179
- rubygems_version: 2.5.1
193
+ rubygems_version: 2.6.2
180
194
  signing_key:
181
195
  specification_version: 4
182
196
  summary: Simple template handler for rouge code samples