drnic-mechanical_github 0.2.0
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/History.txt +4 -0
- data/Manifest.txt +21 -0
- data/README.rdoc +63 -0
- data/Rakefile +26 -0
- data/features/development.feature +13 -0
- data/features/steps/common.rb +194 -0
- data/features/steps/env.rb +6 -0
- data/lib/mechanical_github/repository.rb +24 -0
- data/lib/mechanical_github/session.rb +63 -0
- data/lib/mechanical_github/wiki.rb +31 -0
- data/lib/mechanical_github.rb +11 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/mechanical_github_spec.rb +11 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- data/tasks/rspec.rake +21 -0
- metadata +106 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
Rakefile.orig
|
7
|
+
features/development.feature
|
8
|
+
features/steps/common.rb
|
9
|
+
features/steps/env.rb
|
10
|
+
lib/mechanical_github.rb
|
11
|
+
lib/mechanical_github/repository.rb
|
12
|
+
lib/mechanical_github/session.rb
|
13
|
+
lib/mechanical_github/wiki.rb
|
14
|
+
pkg/mechanical_github-0.0.1.gem
|
15
|
+
script/console
|
16
|
+
script/destroy
|
17
|
+
script/generate
|
18
|
+
spec/mechanical_github_spec.rb
|
19
|
+
spec/spec.opts
|
20
|
+
spec/spec_helper.rb
|
21
|
+
tasks/rspec.rake
|
data/README.rdoc
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
= mechanical_github
|
2
|
+
|
3
|
+
* http://drnic.github.com/mechanical_github
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
This gem provides a automated API for working with github.
|
8
|
+
|
9
|
+
== SYNOPSIS:
|
10
|
+
|
11
|
+
This will give you a session to work with.
|
12
|
+
|
13
|
+
sess = MechanicalGithub::Session.new
|
14
|
+
|
15
|
+
Make the session logged in to github - needed for private repos or write
|
16
|
+
operations.
|
17
|
+
|
18
|
+
sess.login(username, password)
|
19
|
+
|
20
|
+
Creates a repository for the passed in repository. Returns the repo if
|
21
|
+
successful, or nil if not
|
22
|
+
|
23
|
+
sess.create_repository(repository)
|
24
|
+
|
25
|
+
Will return a repository object for the given repository name and username.
|
26
|
+
Calling without a username will return the named repository for the currently
|
27
|
+
logged in username
|
28
|
+
|
29
|
+
sess.get_repository(repository_name, username)
|
30
|
+
sess.get_repository(repository_name)
|
31
|
+
|
32
|
+
== REQUIREMENTS:
|
33
|
+
|
34
|
+
* mechanize gem
|
35
|
+
|
36
|
+
== INSTALL:
|
37
|
+
|
38
|
+
* sudo gem install drnic-mechanical_github --source http://gems.github.com
|
39
|
+
|
40
|
+
== LICENSE:
|
41
|
+
|
42
|
+
(The MIT License)
|
43
|
+
|
44
|
+
Copyright (c) 2009 Dr Nic Williams, http://mocra.com + http://drnicwilliams.com
|
45
|
+
|
46
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
47
|
+
a copy of this software and associated documentation files (the
|
48
|
+
'Software'), to deal in the Software without restriction, including
|
49
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
50
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
51
|
+
permit persons to whom the Software is furnished to do so, subject to
|
52
|
+
the following conditions:
|
53
|
+
|
54
|
+
The above copyright notice and this permission notice shall be
|
55
|
+
included in all copies or substantial portions of the Software.
|
56
|
+
|
57
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
58
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
59
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
60
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
61
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
62
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
63
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem].each { |f| require f }
|
2
|
+
require File.dirname(__FILE__) + '/lib/mechanical_github'
|
3
|
+
|
4
|
+
# Generate all the Rake tasks
|
5
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
6
|
+
$hoe = Hoe.new('mechanical_github', MechanicalGithub::VERSION) do |p|
|
7
|
+
p.developer('Dr Nic Williams', 'drnicwilliams@gmail.com')
|
8
|
+
p.developer('Lincoln Stoll', 'lstoll@lstoll.net')
|
9
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
10
|
+
p.extra_deps = [
|
11
|
+
['mechanize'],
|
12
|
+
]
|
13
|
+
p.extra_dev_deps = [
|
14
|
+
['newgem', ">= #{::Newgem::VERSION}"]
|
15
|
+
]
|
16
|
+
|
17
|
+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
18
|
+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
19
|
+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
20
|
+
p.rsync_args = '-av --delete --ignore-errors'
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'newgem/tasks' # load /tasks/*.rake
|
24
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
25
|
+
|
26
|
+
task :default => [:spec, :features]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Development processes of newgem itself (rake tasks)
|
2
|
+
|
3
|
+
As a Newgem maintainer or contributor
|
4
|
+
I want rake tasks to maintain and release the gem
|
5
|
+
So that I can spend time on the tests and code, and not excessive time on maintenance processes
|
6
|
+
|
7
|
+
Scenario: Generate RubyGem
|
8
|
+
Given this project is active project folder
|
9
|
+
And 'pkg' folder is deleted
|
10
|
+
When task 'rake gem' is invoked
|
11
|
+
Then folder 'pkg' is created
|
12
|
+
And file with name matching 'pkg/*.gem' is created else you should run "rake manifest" to fix this
|
13
|
+
And gem spec key 'rdoc_options' contains /--mainREADME.rdoc/
|
@@ -0,0 +1,194 @@
|
|
1
|
+
def in_project_folder(&block)
|
2
|
+
project_folder = @active_project_folder || @tmp_root
|
3
|
+
FileUtils.chdir(project_folder, &block)
|
4
|
+
end
|
5
|
+
|
6
|
+
def in_home_folder(&block)
|
7
|
+
FileUtils.chdir(@home_path, &block)
|
8
|
+
end
|
9
|
+
|
10
|
+
Given %r{^a safe folder} do
|
11
|
+
FileUtils.rm_rf @tmp_root = File.dirname(__FILE__) + "/../../tmp"
|
12
|
+
FileUtils.mkdir_p @tmp_root
|
13
|
+
FileUtils.mkdir_p @home_path = File.expand_path(File.join(@tmp_root, "home"))
|
14
|
+
@lib_path = File.expand_path(File.dirname(__FILE__) + '/../../lib')
|
15
|
+
Given "env variable $HOME set to '#{@home_path}'"
|
16
|
+
end
|
17
|
+
|
18
|
+
Given %r{^this project is active project folder} do
|
19
|
+
Given "a safe folder"
|
20
|
+
@active_project_folder = File.expand_path(File.dirname(__FILE__) + "/../..")
|
21
|
+
end
|
22
|
+
|
23
|
+
Given %r{^env variable \$([\w_]+) set to '(.*)'} do |env_var, value|
|
24
|
+
ENV[env_var] = value
|
25
|
+
end
|
26
|
+
|
27
|
+
def force_local_lib_override(project_name = @project_name)
|
28
|
+
rakefile = File.read(File.join(project_name, 'Rakefile'))
|
29
|
+
File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
|
30
|
+
f << "$:.unshift('#{@lib_path}')\n"
|
31
|
+
f << rakefile
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def setup_active_project_folder project_name
|
36
|
+
@active_project_folder = File.join(@tmp_root, project_name)
|
37
|
+
@project_name = project_name
|
38
|
+
end
|
39
|
+
|
40
|
+
Given %r{'(.*)' folder is deleted} do |folder|
|
41
|
+
in_project_folder do
|
42
|
+
FileUtils.rm_rf folder
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
When %r{^'(.*)' generator is invoked with arguments '(.*)'$} do |generator, arguments|
|
47
|
+
@stdout = StringIO.new
|
48
|
+
FileUtils.chdir(@active_project_folder) do
|
49
|
+
if Object.const_defined?("APP_ROOT")
|
50
|
+
APP_ROOT.replace(FileUtils.pwd)
|
51
|
+
else
|
52
|
+
APP_ROOT = FileUtils.pwd
|
53
|
+
end
|
54
|
+
run_generator(generator, arguments.split(' '), SOURCES, :stdout => @stdout)
|
55
|
+
end
|
56
|
+
File.open(File.join(@tmp_root, "generator.out"), "w") do |f|
|
57
|
+
@stdout.rewind
|
58
|
+
f << @stdout.read
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
When %r{run executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
63
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
64
|
+
in_project_folder do
|
65
|
+
system "#{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
When %r{run project executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
70
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
71
|
+
in_project_folder do
|
72
|
+
system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
When %r{run local executable '(.*)' with arguments '(.*)'} do |executable, arguments|
|
77
|
+
@stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
|
78
|
+
executable = File.expand_path(File.join(File.dirname(__FILE__), "/../../bin", executable))
|
79
|
+
in_project_folder do
|
80
|
+
system "ruby #{executable} #{arguments} > #{@stdout} 2> #{@stdout}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
When %r{^task 'rake (.*)' is invoked$} do |task|
|
85
|
+
@stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
|
86
|
+
FileUtils.chdir(@active_project_folder) do
|
87
|
+
system "rake #{task} --trace > #{@stdout} 2> #{@stdout}"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
Then %r{^folder '(.*)' (is|is not) created} do |folder, is|
|
92
|
+
in_project_folder do
|
93
|
+
File.exists?(folder).should(is == 'is' ? be_true : be_false)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
Then %r{^file '(.*)' (is|is not) created} do |file, is|
|
98
|
+
in_project_folder do
|
99
|
+
File.exists?(file).should(is == 'is' ? be_true : be_false)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
Then %r{^file with name matching '(.*)' is created} do |pattern|
|
104
|
+
in_project_folder do
|
105
|
+
Dir[pattern].should_not be_empty
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
Then %r{gem file '(.*)' and generated file '(.*)' should be the same} do |gem_file, project_file|
|
110
|
+
File.exists?(gem_file).should be_true
|
111
|
+
File.exists?(project_file).should be_true
|
112
|
+
gem_file_contents = File.read(File.dirname(__FILE__) + "/../../#{gem_file}")
|
113
|
+
project_file_contents = File.read(File.join(@active_project_folder, project_file))
|
114
|
+
project_file_contents.should == gem_file_contents
|
115
|
+
end
|
116
|
+
|
117
|
+
Then %r{^output same as contents of '(.*)'$} do |file|
|
118
|
+
expected_output = File.read(File.join(File.dirname(__FILE__) + "/../expected_outputs", file))
|
119
|
+
actual_output = File.read(@stdout)
|
120
|
+
actual_output.should == expected_output
|
121
|
+
end
|
122
|
+
|
123
|
+
Then %r{^(does|does not) invoke generator '(.*)'$} do |does_invoke, generator|
|
124
|
+
actual_output = File.read(@stdout)
|
125
|
+
does_invoke == "does" ?
|
126
|
+
actual_output.should(match(/dependency\s+#{generator}/)) :
|
127
|
+
actual_output.should_not(match(/dependency\s+#{generator}/))
|
128
|
+
end
|
129
|
+
|
130
|
+
Then %r{help options '(.*)' and '(.*)' are displayed} do |opt1, opt2|
|
131
|
+
actual_output = File.read(@stdout)
|
132
|
+
actual_output.should match(/#{opt1}/)
|
133
|
+
actual_output.should match(/#{opt2}/)
|
134
|
+
end
|
135
|
+
|
136
|
+
Then %r{^output (does|does not) match \/(.*)\/} do |does, regex|
|
137
|
+
actual_output = File.read(@stdout)
|
138
|
+
(does == 'does') ?
|
139
|
+
actual_output.should(match(/#{regex}/)) :
|
140
|
+
actual_output.should_not(match(/#{regex}/))
|
141
|
+
end
|
142
|
+
|
143
|
+
Then %r{^contents of file '(.*)' (does|does not) match \/(.*)\/} do |file, does, regex|
|
144
|
+
in_project_folder do
|
145
|
+
actual_output = File.read(file)
|
146
|
+
(does == 'does') ?
|
147
|
+
actual_output.should(match(/#{regex}/)) :
|
148
|
+
actual_output.should_not(match(/#{regex}/))
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
Then %r{^all (\d+) tests pass} do |expected_test_count|
|
153
|
+
expected = %r{^#{expected_test_count} tests, \d+ assertions, 0 failures, 0 errors}
|
154
|
+
actual_output = File.read(@stdout)
|
155
|
+
actual_output.should match(expected)
|
156
|
+
end
|
157
|
+
|
158
|
+
Then %r{^all (\d+) examples pass} do |expected_test_count|
|
159
|
+
expected = %r{^#{expected_test_count} examples?, 0 failures}
|
160
|
+
actual_output = File.read(@stdout)
|
161
|
+
actual_output.should match(expected)
|
162
|
+
end
|
163
|
+
|
164
|
+
Then %r{^yaml file '(.*)' contains (\{.*\})} do |file, yaml|
|
165
|
+
in_project_folder do
|
166
|
+
yaml = eval yaml
|
167
|
+
YAML.load(File.read(file)).should == yaml
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
Then %r{^Rakefile can display tasks successfully} do
|
172
|
+
@stdout = File.expand_path(File.join(@tmp_root, "rakefile.out"))
|
173
|
+
FileUtils.chdir(@active_project_folder) do
|
174
|
+
system "rake -T > #{@stdout} 2> #{@stdout}"
|
175
|
+
end
|
176
|
+
actual_output = File.read(@stdout)
|
177
|
+
actual_output.should match(/^rake\s+\w+\s+#\s.*/)
|
178
|
+
end
|
179
|
+
|
180
|
+
Then %r{^task 'rake (.*)' is executed successfully} do |task|
|
181
|
+
@stdout.should_not be_nil
|
182
|
+
actual_output = File.read(@stdout)
|
183
|
+
actual_output.should_not match(/^Don't know how to build task '#{task}'/)
|
184
|
+
actual_output.should_not match(/Error/i)
|
185
|
+
end
|
186
|
+
|
187
|
+
Then %r{^gem spec key '(.*)' contains \/(.*)\/} do |key, regex|
|
188
|
+
in_project_folder do
|
189
|
+
gem_file = Dir["pkg/*.gem"].first
|
190
|
+
gem_spec = Gem::Specification.from_yaml(`gem spec #{gem_file}`)
|
191
|
+
spec_value = gem_spec.send(key.to_sym)
|
192
|
+
spec_value.to_s.should match(/#{regex}/)
|
193
|
+
end
|
194
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module MechanicalGithub
|
2
|
+
|
3
|
+
# represents a project
|
4
|
+
class Repository
|
5
|
+
attr_reader :name, :description, :homepage, :username
|
6
|
+
|
7
|
+
def initialize(session, name, username, description, homepage)
|
8
|
+
@name = name
|
9
|
+
@description = description
|
10
|
+
@homepage = homepage
|
11
|
+
@username = username
|
12
|
+
@session = session
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.url_for(username, name)
|
16
|
+
"https://github.com/#{username}/#{name}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def wiki
|
20
|
+
Wiki.new(self, @session)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module MechanicalGithub
|
2
|
+
class Session
|
3
|
+
attr_reader :agent, :username, :logged_in
|
4
|
+
|
5
|
+
# set up an agent witht the provided credentials, and log in to github with it.
|
6
|
+
def initialize()
|
7
|
+
@agent = WWW::Mechanize.new
|
8
|
+
@logged_in = false
|
9
|
+
end
|
10
|
+
|
11
|
+
# will need to do this to access private repos or be able to create stuff.
|
12
|
+
def login(username, password)
|
13
|
+
@username = username
|
14
|
+
|
15
|
+
loginpage = @agent.get('https://github.com/login')
|
16
|
+
loginform = loginpage.forms[0]
|
17
|
+
|
18
|
+
loginform['login'] = username
|
19
|
+
loginform['password'] = password
|
20
|
+
loginform['remember_me'] = '1' # make the session 'stick' a little longer, hopefully.
|
21
|
+
loginpage = @agent.submit(loginform)
|
22
|
+
@logged_in = true
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
def create_repository(name, description, homepage)
|
27
|
+
return unless @logged_in
|
28
|
+
newpage = @agent.get('http://github.com/repositories/new')
|
29
|
+
# create the repo
|
30
|
+
newform = newpage.forms[1]
|
31
|
+
#p form
|
32
|
+
newform['repository[name]'] = name
|
33
|
+
newform['repository[description]'] = description
|
34
|
+
newform['repository[homepage]'] = homepage
|
35
|
+
newform['repository[public]'] = true #always want it to be public
|
36
|
+
|
37
|
+
finishpage = @agent.submit(newform)
|
38
|
+
|
39
|
+
# TODO - error handle here - regex for error or something. rtn the new repo if OK, nil if not.
|
40
|
+
|
41
|
+
Repository.new(self, name, @username, description, homepage)
|
42
|
+
end
|
43
|
+
|
44
|
+
def find_repository(repository_name, username=@username)
|
45
|
+
return unless username
|
46
|
+
repopage = @agent.get(Repository.url_for(username, repository_name))
|
47
|
+
description = repopage.search("//span[@id='repository_description']").inner_html
|
48
|
+
homepage = repopage.search("//span[@id='repository_homepage']").inner_html
|
49
|
+
# because the fields on a repo are currently immutable, we have to create a new repo and return
|
50
|
+
Repository.new(self, repository_name, username, description, homepage)
|
51
|
+
end
|
52
|
+
|
53
|
+
def send_message(to, subject, body)
|
54
|
+
return unless @logged_in
|
55
|
+
newpage = @agent.get('http://github.com/inbox/new')
|
56
|
+
newform = newpage.forms[1]
|
57
|
+
newform['message[to]'] = to
|
58
|
+
newform['message[subject]'] = subject
|
59
|
+
newform['message[body]'] = body
|
60
|
+
@agent.submit(newform)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module MechanicalGithub
|
2
|
+
|
3
|
+
class Wiki
|
4
|
+
attr_reader :project
|
5
|
+
|
6
|
+
def initialize(repository, session)
|
7
|
+
@repository = repository
|
8
|
+
@session = session
|
9
|
+
end
|
10
|
+
|
11
|
+
def url
|
12
|
+
"https://github.com/#{@repository.username}/#{repository.name}/wikis"
|
13
|
+
end
|
14
|
+
|
15
|
+
def pages
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
class WikiPage
|
22
|
+
attr_reader :name, :content
|
23
|
+
|
24
|
+
def initialize(name, content, session=nil)
|
25
|
+
@name = name
|
26
|
+
@content = @content
|
27
|
+
@session = session
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#
|
2
|
+
# automates the creation of a git repository on github.
|
3
|
+
require 'rubygems'
|
4
|
+
require 'mechanize'
|
5
|
+
|
6
|
+
module MechanicalGithub
|
7
|
+
VERSION="0.2.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
# load all files
|
11
|
+
Dir["#{File.join(File.dirname(__FILE__), "mechanical_github")}/*.rb"].each { |file| require(file) }
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/mechanical_github.rb'}"
|
9
|
+
puts "Loading mechanical_github gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: drnic-mechanical_github
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dr Nic Williams
|
8
|
+
- Lincoln Stoll
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-01-23 00:00:00 -08:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: mechanize
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: newgem
|
27
|
+
version_requirement:
|
28
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.2.3
|
33
|
+
version:
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: hoe
|
36
|
+
version_requirement:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 1.8.0
|
42
|
+
version:
|
43
|
+
description: This gem provides a automated API for working with github.
|
44
|
+
email:
|
45
|
+
- drnicwilliams@gmail.com
|
46
|
+
- lstoll@lstoll.net
|
47
|
+
executables: []
|
48
|
+
|
49
|
+
extensions: []
|
50
|
+
|
51
|
+
extra_rdoc_files:
|
52
|
+
- History.txt
|
53
|
+
- Manifest.txt
|
54
|
+
- PostInstall.txt
|
55
|
+
- README.rdoc
|
56
|
+
files:
|
57
|
+
- History.txt
|
58
|
+
- Manifest.txt
|
59
|
+
- PostInstall.txt
|
60
|
+
- README.rdoc
|
61
|
+
- Rakefile
|
62
|
+
- Rakefile.orig
|
63
|
+
- features/development.feature
|
64
|
+
- features/steps/common.rb
|
65
|
+
- features/steps/env.rb
|
66
|
+
- lib/mechanical_github.rb
|
67
|
+
- lib/mechanical_github/repository.rb
|
68
|
+
- lib/mechanical_github/session.rb
|
69
|
+
- lib/mechanical_github/wiki.rb
|
70
|
+
- pkg/mechanical_github-0.0.1.gem
|
71
|
+
- script/console
|
72
|
+
- script/destroy
|
73
|
+
- script/generate
|
74
|
+
- spec/mechanical_github_spec.rb
|
75
|
+
- spec/spec.opts
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
- tasks/rspec.rake
|
78
|
+
has_rdoc: true
|
79
|
+
homepage: http://drnic.github.com/mechanical_github
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options:
|
82
|
+
- --main
|
83
|
+
- README.rdoc
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: "0"
|
91
|
+
version:
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: "0"
|
97
|
+
version:
|
98
|
+
requirements: []
|
99
|
+
|
100
|
+
rubyforge_project: mechanical_github
|
101
|
+
rubygems_version: 1.2.0
|
102
|
+
signing_key:
|
103
|
+
specification_version: 2
|
104
|
+
summary: This gem provides a automated API for working with github.
|
105
|
+
test_files: []
|
106
|
+
|