brightly 0.1.1 → 0.1.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/README.rdoc +1 -3
- data/VERSION +1 -1
- data/brightly.gemspec +3 -3
- data/config.ru +8 -0
- data/lib/brightly.rb +0 -2
- data/lib/brightly/provider/exec.rb +10 -1
- metadata +3 -3
- data/lib/brightly/consumer.rb +0 -26
data/README.rdoc
CHANGED
@@ -54,9 +54,7 @@ config.ru:
|
|
54
54
|
|
55
55
|
== Client Usage
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
gem.config :lib => false, :version => '>=0.1.0', :source => "http://gemcutter.org"
|
57
|
+
The simplest way to use brighten in a rails application is to create a helper method that can make the requests. You could likely create an ActiveResource model for this, but the data is hardly representative of a model, so a simple method call makes more sense.
|
60
58
|
|
61
59
|
config/initializers/brightly.rb:
|
62
60
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/brightly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{brightly}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Adam Elliot"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-23}
|
13
13
|
s.default_executable = %q{brightly}
|
14
14
|
s.description = %q{Adds syntax highlighting and some other code stuff to Markdown}
|
15
15
|
s.email = %q{adam@warptube.com}
|
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
"VERSION",
|
28
28
|
"bin/brightly",
|
29
29
|
"brightly.gemspec",
|
30
|
+
"config.ru",
|
30
31
|
"lib/brightly.rb",
|
31
|
-
"lib/brightly/consumer.rb",
|
32
32
|
"lib/brightly/provider/base.rb",
|
33
33
|
"lib/brightly/provider/config.rb",
|
34
34
|
"lib/brightly/provider/exec.rb",
|
data/config.ru
ADDED
data/lib/brightly.rb
CHANGED
@@ -14,9 +14,18 @@ module Brightly
|
|
14
14
|
opts.on('-s server') { |val| options[:server] = val }
|
15
15
|
opts.on('-e env') { |val| options[:environment] = val.to_sym }
|
16
16
|
opts.on('-p port') { |val| options[:port] = val.to_i }
|
17
|
+
|
18
|
+
opts.on('-r', '--rack-file', 'Prints the path to the builtin rack file and the contents of the file.') do
|
19
|
+
a = File.dirname(__FILE__).split(File::SEPARATOR)
|
20
|
+
a.slice!(-5, 5)
|
21
|
+
config = File.join(a.join('/'), 'config.ru')
|
22
|
+
puts "#{config}:"
|
23
|
+
puts File.read(config)
|
24
|
+
exit
|
25
|
+
end
|
17
26
|
|
18
27
|
opts.on_tail('-h', '--help', "Show this message") { puts opts ; exit }
|
19
|
-
end
|
28
|
+
end.parse!
|
20
29
|
|
21
30
|
Brightly::Provider::Base.run! options
|
22
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Elliot
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-23 00:00:00 -07:00
|
13
13
|
default_executable: brightly
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -80,8 +80,8 @@ files:
|
|
80
80
|
- VERSION
|
81
81
|
- bin/brightly
|
82
82
|
- brightly.gemspec
|
83
|
+
- config.ru
|
83
84
|
- lib/brightly.rb
|
84
|
-
- lib/brightly/consumer.rb
|
85
85
|
- lib/brightly/provider/base.rb
|
86
86
|
- lib/brightly/provider/config.rb
|
87
87
|
- lib/brightly/provider/exec.rb
|
data/lib/brightly/consumer.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module Brightly
|
4
|
-
module Consumer
|
5
|
-
class << self
|
6
|
-
attr_accessor :theme, :provider_url
|
7
|
-
end
|
8
|
-
|
9
|
-
module AssetHelper
|
10
|
-
# Return the javascript tag that include the token if the user's authenticated
|
11
|
-
def brightly_stylesheet_link_tag
|
12
|
-
"<link rel=\"stylesheet\" href=\"#{Brightly::Consumer.provider_url}/stylesheets/#{Brightly::Consumer.theme}.css\" type=\"text/css\" media=\"screen\" charset=\"utf-8\">"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module ProviderHelper
|
17
|
-
def brighten(markdown, theme = Brightly::Consumer.theme)
|
18
|
-
Net::HTTP.post_form(URI.parse("#{Brightly::Consumer.provider_url}/brighten"), {:markdown => markdown, :theme => theme}).body
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
::ActionView::Base.send(:include, Brightly::Consumer::AssetHelper) if defined? ::ActionView::Base
|
25
|
-
::ActiveRecord::Base.send(:include, Brightly::Consumer::ProviderHelper) if defined? ::ActiveRecord::Base
|
26
|
-
::ActionController::Base.send(:include, Brightly::Consumer::ProviderHelper) if defined? ::ActionController::Base
|