toadhopper-sinatra 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ /pkg/
2
+ .yardoc
3
+ toadhopper-sinatra.gemspec
4
+ /doc/
@@ -0,0 +1,4 @@
1
+ -r
2
+ README.md
3
+ -
4
+ LICENSE
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
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2009 Tim Lucas
3
+ Copyright (c) 2009-10 Tim Lucas
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- require 'rake/testtask'
1
+ Bundler.setup(:default, :development, :test)
2
+ Bundler.require(:development, :test)
2
3
 
3
- Rake::TestTask.new do |t|
4
- t.libs << "test"
5
- t.test_files = FileList['test/test*.rb']
6
- t.verbose = true
7
- end
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
- begin
10
- gem "sr-mg", "<= 0.0.5"
11
- require "mg"
12
- MG.new("toadhopper-sinatra.gemspec")
13
- rescue Gem::LoadError
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
- begin
17
- gem "yard"
18
- require 'yard'
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
@@ -3,15 +3,15 @@ require 'toadhopper'
3
3
 
4
4
  module Sinatra
5
5
  # The Toadhopper helper methods
6
- module ToadHopper
7
- VERSION = "1.0.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 "ToadHopper api key not set, e.g. set :toadhopper, :api_key => 'my api key'"
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 = ToadHopper(options.toadhopper[:api_key])
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 ToadHopper
33
+ helpers Toadhopper
34
34
  end
@@ -1,16 +1,10 @@
1
- toadhopper_dir = "#{File.dirname(__FILE__)}/../toadhopper"
2
- raise "#{toadhopper_dir} does not exist" unless File.directory?(toadhopper_dir)
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
- require 'exemplor'
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 = ::ToadHopper.new("")
27
- stub(::ToadHopper).new do |api_key|
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.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.9.8
23
+ version: 1.0.0
24
24
  version:
25
- description: Post Hoptoad notifications from Sinatra
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: th-sinatra
78
+ rubyforge_project:
65
79
  rubygems_version: 1.3.5
66
80
  signing_key:
67
81
  specification_version: 3