toadhopper-sinatra 1.0.0 → 1.0.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/.gitignore +4 -0
- data/.yardopts +4 -0
- data/Gemfile +17 -0
- data/LICENSE +1 -1
- data/README.md +17 -0
- data/Rakefile +20 -18
- data/lib/sinatra/toadhopper.rb +5 -5
- data/test_example.rb +5 -11
- metadata +23 -9
data/.gitignore
ADDED
data/.yardopts
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source :gemcutter
|
2
|
+
|
3
|
+
gem 'toadhopper', '1.0.0'
|
4
|
+
gem 'sinatra'
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem 'rake'
|
8
|
+
gem 'yard'
|
9
|
+
gem 'jeweler'
|
10
|
+
end
|
11
|
+
|
12
|
+
group :test do
|
13
|
+
gem 'rake'
|
14
|
+
gem 'exemplor'
|
15
|
+
gem 'rack-test', :require => "rack/test"
|
16
|
+
gem 'rr'
|
17
|
+
end
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -19,3 +19,20 @@
|
|
19
19
|
For usage see example.rb. To install:
|
20
20
|
|
21
21
|
gem install toadhopper-sinatra
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
Install Bundler 0.9.x, then:
|
26
|
+
|
27
|
+
% git clone git://github.com/toolmantim/toadhopper-sinatra.git
|
28
|
+
% cd toadhopper-sinatra
|
29
|
+
% bundle install
|
30
|
+
% bundle exec rake test
|
31
|
+
|
32
|
+
To generate the docs:
|
33
|
+
|
34
|
+
% bundle exec yardoc
|
35
|
+
|
36
|
+
To build the gem:
|
37
|
+
|
38
|
+
% bundle exec rake build
|
data/Rakefile
CHANGED
@@ -1,23 +1,25 @@
|
|
1
|
-
|
1
|
+
Bundler.setup(:default, :development, :test)
|
2
|
+
Bundler.require(:development, :test)
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
Jeweler::Tasks.new do |s|
|
5
|
+
s.name = "toadhopper-sinatra"
|
6
|
+
s.summary = "Post Hoptoad notifications from Sinatra"
|
7
|
+
s.email = "t.lucas@toolmantim.com"
|
8
|
+
s.homepage = "http://github.com/toolmantim/toadhopper-sinatra"
|
9
|
+
s.authors = ["Tim Lucas"]
|
10
|
+
s.extra_rdoc_files = ["README.md", "LICENSE", "example.rb"]
|
11
|
+
|
12
|
+
require File.join(File.dirname(__FILE__), 'lib', 'sinatra', 'toadhopper')
|
13
|
+
s.version = Sinatra::Toadhopper::VERSION
|
8
14
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
15
|
+
require 'bundler'
|
16
|
+
bundle = Bundler::Definition.from_gemfile("Gemfile")
|
17
|
+
bundle.dependencies.
|
18
|
+
select { |d| d.groups.include?(:default) || d.groups.include?(:runtime) }.
|
19
|
+
each { |d| s.add_dependency(d.name, d.version_requirements.to_s) }
|
14
20
|
end
|
15
21
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
YARD::Rake::YardocTask.new do |t|
|
20
|
-
t.options = ['-r', 'README.md', '--files', 'example.rb', 'LICENSE', 'example.rb'] # optional
|
21
|
-
end
|
22
|
-
rescue Gem::LoadError
|
22
|
+
desc "Run tests"
|
23
|
+
task :test do
|
24
|
+
exec "/usr/bin/env ruby #{File.dirname(__FILE__)}/test_example.rb"
|
23
25
|
end
|
data/lib/sinatra/toadhopper.rb
CHANGED
@@ -3,15 +3,15 @@ require 'toadhopper'
|
|
3
3
|
|
4
4
|
module Sinatra
|
5
5
|
# The Toadhopper helper methods
|
6
|
-
module
|
7
|
-
VERSION = "1.0.
|
6
|
+
module Toadhopper
|
7
|
+
VERSION = "1.0.2"
|
8
8
|
# Reports the current sinatra error to Hoptoad
|
9
9
|
def post_error_to_hoptoad!
|
10
10
|
unless options.toadhopper && options.toadhopper[:api_key]
|
11
|
-
STDERR.puts "
|
11
|
+
STDERR.puts "Toadhopper api key not set, e.g. set :toadhopper, :api_key => 'my api key'"
|
12
12
|
return
|
13
13
|
end
|
14
|
-
toadhopper =
|
14
|
+
toadhopper = Toadhopper(options.toadhopper[:api_key])
|
15
15
|
toadhopper.filters = options.toadhopper[:filters] if options.toadhopper[:filters]
|
16
16
|
toadhopper.post!(
|
17
17
|
env['sinatra.error'],
|
@@ -30,5 +30,5 @@ module Sinatra
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
end
|
33
|
-
helpers
|
33
|
+
helpers Toadhopper
|
34
34
|
end
|
data/test_example.rb
CHANGED
@@ -1,16 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$:.unshift "#{toadhopper_dir}/lib"
|
1
|
+
Bundler.setup(:default, :test)
|
2
|
+
Bundler.require(:test)
|
4
3
|
|
5
4
|
$:.unshift "#{File.dirname(__FILE__)}/lib"
|
6
|
-
|
7
5
|
require "#{File.dirname(__FILE__)}/example"
|
8
|
-
Sinatra::Application.set :environment, :production
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
require 'rack/test'
|
13
|
-
require 'rr'
|
7
|
+
Sinatra::Application.set :environment, :production
|
14
8
|
|
15
9
|
eg.helpers do
|
16
10
|
include Rack::Test::Methods
|
@@ -23,8 +17,8 @@ end
|
|
23
17
|
eg.setup do
|
24
18
|
RR.reset
|
25
19
|
|
26
|
-
@toadhopper = ::
|
27
|
-
stub(::
|
20
|
+
@toadhopper = ::Toadhopper.new("")
|
21
|
+
stub(::Toadhopper).new do |api_key|
|
28
22
|
@api_key = api_key
|
29
23
|
@toadhopper
|
30
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toadhopper-sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Lucas
|
@@ -20,31 +20,45 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 1.0.0
|
24
24
|
version:
|
25
|
-
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sinatra
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
description:
|
26
36
|
email: t.lucas@toolmantim.com
|
27
37
|
executables: []
|
28
38
|
|
29
39
|
extensions: []
|
30
40
|
|
31
41
|
extra_rdoc_files:
|
32
|
-
- README.md
|
33
42
|
- LICENSE
|
43
|
+
- README.md
|
44
|
+
- example.rb
|
34
45
|
files:
|
46
|
+
- .gitignore
|
47
|
+
- .yardopts
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE
|
35
50
|
- README.md
|
36
51
|
- Rakefile
|
37
|
-
- LICENSE
|
38
|
-
- lib/sinatra/toadhopper.rb
|
39
52
|
- example.rb
|
53
|
+
- lib/sinatra/toadhopper.rb
|
40
54
|
- test_example.rb
|
41
55
|
has_rdoc: true
|
42
56
|
homepage: http://github.com/toolmantim/toadhopper-sinatra
|
43
57
|
licenses: []
|
44
58
|
|
45
59
|
post_install_message:
|
46
|
-
rdoc_options:
|
47
|
-
|
60
|
+
rdoc_options:
|
61
|
+
- --charset=UTF-8
|
48
62
|
require_paths:
|
49
63
|
- lib
|
50
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -61,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
75
|
version:
|
62
76
|
requirements: []
|
63
77
|
|
64
|
-
rubyforge_project:
|
78
|
+
rubyforge_project:
|
65
79
|
rubygems_version: 1.3.5
|
66
80
|
signing_key:
|
67
81
|
specification_version: 3
|