jsmestad-gripht_check 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/LICENSE +20 -0
- data/README.textile +7 -0
- data/Rakefile +41 -0
- data/TODO +2 -0
- data/VERSION +1 -0
- data/config.ru.example +9 -0
- data/lib/gripht.rb +21 -0
- data/lib/gripht/app.rb +26 -0
- data/lib/gripht/views/application.js +3 -0
- data/lib/gripht/views/failed.haml +6 -0
- data/lib/gripht/views/index.haml +13 -0
- data/lib/gripht/views/layout.haml +13 -0
- data/spec/fixtures.rb +0 -0
- data/spec/gripht_spec.rb +8 -0
- data/spec/spec_helper.rb +40 -0
- metadata +150 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Justin Smestad
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'spec/rake/spectask'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "gripht_check"
|
9
|
+
gem.summary = %Q{TODO}
|
10
|
+
gem.email = "justin.smestad@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/jsmestad/gripht"
|
12
|
+
gem.authors = ["Justin Smestad"]
|
13
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
|
+
|
15
|
+
gem.add_dependency "sinatra", ">= 0.9.1.1"
|
16
|
+
gem.add_dependency "rubigen", ">= 1.5.2"
|
17
|
+
gem.add_dependency "rack-test", ">= 0.1.0"
|
18
|
+
gem.add_dependency "webrat", ">= 0.4.3"
|
19
|
+
gem.add_dependency "fakeweb", ">= 1.2.0"
|
20
|
+
gem.add_dependency 'haml', ">= 2.0.9"
|
21
|
+
gem.add_dependency 'rest-client', ">= 0.9.2"
|
22
|
+
gem.add_dependency 'nokogiri'
|
23
|
+
end
|
24
|
+
|
25
|
+
rescue LoadError
|
26
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
27
|
+
end
|
28
|
+
|
29
|
+
task :default => :spec
|
30
|
+
|
31
|
+
desc "Run specs"
|
32
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
33
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
34
|
+
t.spec_opts = %w(-fs --color)
|
35
|
+
t.spec_opts << '--loadby' << 'random'
|
36
|
+
|
37
|
+
t.rcov_opts << '--exclude' << 'spec'
|
38
|
+
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
39
|
+
t.rcov_opts << '--text-summary'
|
40
|
+
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
41
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/config.ru.example
ADDED
data/lib/gripht.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'sinatra/base'
|
3
|
+
require 'haml/util'
|
4
|
+
require 'haml/engine'
|
5
|
+
require 'rest_client'
|
6
|
+
require 'logger'
|
7
|
+
require 'nokogiri'
|
8
|
+
|
9
|
+
module Gripht
|
10
|
+
module Log
|
11
|
+
def self.logger
|
12
|
+
if @logger.nil?
|
13
|
+
@logger = Logger.new("lifeline.log")
|
14
|
+
@logger.level = Logger::INFO
|
15
|
+
end
|
16
|
+
@logger
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
require File.dirname(__FILE__) + '/gripht/app'
|
data/lib/gripht/app.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Gripht
|
2
|
+
class App < Sinatra::Default
|
3
|
+
set :views, File.dirname(__FILE__) + '/views'
|
4
|
+
|
5
|
+
helpers do
|
6
|
+
# something goes here...
|
7
|
+
end
|
8
|
+
|
9
|
+
errors do
|
10
|
+
Gripht::Log.logger.info env['sinatra.error'].message
|
11
|
+
haml :failed
|
12
|
+
end
|
13
|
+
|
14
|
+
get '/application.js' do
|
15
|
+
@application_js ||= File.read(File.dirname(__FILE__) + '/views/application.js')
|
16
|
+
end
|
17
|
+
|
18
|
+
get '/' do
|
19
|
+
resource = RestClient::Resource.new 'http://www.pivotaltracker.com/services/v2/projects', :headers => { 'X-TrackerToken' => ENV['TRACKER_TOKEN']}
|
20
|
+
@projects = Nokogiri::XML.parse(resource.get).xpath('//project').collect { |r| { :id => r.at('id').content, :name => r.at('name').content } }
|
21
|
+
|
22
|
+
haml :index
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
!!!Strict
|
2
|
+
%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
|
3
|
+
%head
|
4
|
+
%title Gripht -- Default Install
|
5
|
+
%meta{'http-equiv' => "Content-Type", 'content' => "text/html; charset=utf-8"}
|
6
|
+
%script{:type => 'text/javascript', :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"}
|
7
|
+
%script{:type => 'text/javascript', :src => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"}
|
8
|
+
%script{:type => 'text/javascript', :src => "/application.js"}
|
9
|
+
|
10
|
+
%link{:href => '/css/screen.css', :media => 'screen', :rel => 'stylesheet', :type => 'text/css', :media => 'screen, projection'}
|
11
|
+
|
12
|
+
%body
|
13
|
+
= yield
|
data/spec/fixtures.rb
ADDED
File without changes
|
data/spec/gripht_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
$TESTING=true
|
2
|
+
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
require 'rubygems'
|
4
|
+
require 'randexp'
|
5
|
+
require 'gripht'
|
6
|
+
#require 'dm-core'
|
7
|
+
require 'rack/test'
|
8
|
+
require 'webrat/sinatra'
|
9
|
+
#require 'dm-sweatshop'
|
10
|
+
require 'fakeweb'
|
11
|
+
require 'pp'
|
12
|
+
|
13
|
+
FakeWeb.allow_net_connect = false
|
14
|
+
|
15
|
+
#require File.dirname(__FILE__)+'/fixtures'
|
16
|
+
#DataMapper.setup(:default, 'sqlite3::memory:')
|
17
|
+
|
18
|
+
class Net::HTTPResponse
|
19
|
+
def body=(content)
|
20
|
+
@body = content
|
21
|
+
@read = true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Spec::Runner.configure do |config|
|
26
|
+
config.include(Rack::Test::Methods)
|
27
|
+
config.include(Webrat::Methods)
|
28
|
+
config.include(Webrat::Matchers)
|
29
|
+
|
30
|
+
config.before(:each) do
|
31
|
+
#DataMapper.auto_migrate!
|
32
|
+
FakeWeb.clean_registry
|
33
|
+
end
|
34
|
+
|
35
|
+
def app
|
36
|
+
@app = Rack::Builder.new do
|
37
|
+
run Gripht::App
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jsmestad-gripht_check
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Smestad
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-21 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sinatra
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.9.1.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rubigen
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.5.2
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rack-test
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.1.0
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: webrat
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.4.3
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fakeweb
|
57
|
+
type: :runtime
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.2.0
|
64
|
+
version:
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: haml
|
67
|
+
type: :runtime
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 2.0.9
|
74
|
+
version:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rest-client
|
77
|
+
type: :runtime
|
78
|
+
version_requirement:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.9.2
|
84
|
+
version:
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: nokogiri
|
87
|
+
type: :runtime
|
88
|
+
version_requirement:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: "0"
|
94
|
+
version:
|
95
|
+
description:
|
96
|
+
email: justin.smestad@gmail.com
|
97
|
+
executables: []
|
98
|
+
|
99
|
+
extensions: []
|
100
|
+
|
101
|
+
extra_rdoc_files:
|
102
|
+
- LICENSE
|
103
|
+
- README.textile
|
104
|
+
files:
|
105
|
+
- .gitignore
|
106
|
+
- LICENSE
|
107
|
+
- README.textile
|
108
|
+
- Rakefile
|
109
|
+
- TODO
|
110
|
+
- VERSION
|
111
|
+
- config.ru.example
|
112
|
+
- lib/gripht.rb
|
113
|
+
- lib/gripht/app.rb
|
114
|
+
- lib/gripht/views/application.js
|
115
|
+
- lib/gripht/views/failed.haml
|
116
|
+
- lib/gripht/views/index.haml
|
117
|
+
- lib/gripht/views/layout.haml
|
118
|
+
- spec/fixtures.rb
|
119
|
+
- spec/gripht_spec.rb
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
has_rdoc: false
|
122
|
+
homepage: http://github.com/jsmestad/gripht
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options:
|
125
|
+
- --charset=UTF-8
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: "0"
|
133
|
+
version:
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: "0"
|
139
|
+
version:
|
140
|
+
requirements: []
|
141
|
+
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 1.2.0
|
144
|
+
signing_key:
|
145
|
+
specification_version: 3
|
146
|
+
summary: TODO
|
147
|
+
test_files:
|
148
|
+
- spec/fixtures.rb
|
149
|
+
- spec/gripht_spec.rb
|
150
|
+
- spec/spec_helper.rb
|