gemathon 0.0.1

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/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in creek.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new('spec')
5
+
6
+ # If you want to make this the default task
7
+ task :default => :spec
data/Readme.md ADDED
@@ -0,0 +1,53 @@
1
+ # gemathon
2
+
3
+ This Gem is used to find Repos belonging to an organisation
4
+
5
+ **gemathon** can be used from the command line or as part of a Ruby web framework.
6
+
7
+ ### Installation
8
+
9
+ To install the gem using terminal, run the following command:
10
+
11
+ gem install gemathon
12
+
13
+ To use it in rails application add the gem to the Gemfile:
14
+
15
+ gem "gemathon"
16
+
17
+ ### Basic Usage
18
+
19
+ gemathon can simple list all repos belonging to an organisation
20
+
21
+ require 'gemathon'
22
+ require 'github_api'
23
+
24
+ your_github_username = '***********'
25
+ your_github_password = '***********'
26
+ org_name =["*********","*******"]
27
+
28
+ connection = Github.new(basic_auth: "#{your_github_username}:#{your_github_password}")
29
+
30
+ # The List Module will fetch all the repositories belonging to an organisation
31
+
32
+ @list=Gemathon::List.new(connection,org_name).list
33
+
34
+ ### Contributing
35
+
36
+ Contributions are welcomed. You can fork a repository, add your code changes to the forked branch, ensure all existing unit tests pass, create new unit tests cover your new changes and finally create a pull request.
37
+
38
+ After forking and then cloning the repository locally, install Bundler and then use it
39
+ to install the development gem dependecies:
40
+
41
+ gem install bundler
42
+ bundle install
43
+
44
+ github-contributions this is complete, you should be able to run the test suite:
45
+
46
+ rake spec
47
+
48
+
49
+ ### Bug Reporting
50
+
51
+ Please use the Issues page to report bugs or suggest new enhancements.
52
+
53
+
data/gemathon.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gemathon/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gemathon"
8
+ spec.version = Gemathon::VERSION
9
+ spec.authors = ["Ramtin Vaziri", "Manish puri", "Hemali Jain","Amruta Das","Arpit Kulshrestha"]
10
+ spec.description = %q{Find repositories belonging to organisation.}
11
+ spec.summary = %q{gemathon is a Ruby gem that facilittes easy fetching of repositories belonging to an organisation}
12
+ spec.homepage = "https://github.com/Manik-Ratna/gemathon"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.required_ruby_version = '>= 1.9.3'
21
+
22
+ spec.add_dependency 'github_api'
23
+ spec.add_development_dependency 'rake', '~>10.1.1'
24
+ spec.add_development_dependency 'rspec'
25
+ end
@@ -0,0 +1,26 @@
1
+ require 'github_api'
2
+
3
+ module Gemathon
4
+
5
+ class Gemathon::List
6
+ attr_reader :connection,:org_name
7
+ def initialize connection, org_name,options = {}
8
+ @org_name = org_name
9
+ @connection = connection
10
+ end
11
+
12
+ def list
13
+ @list_repos=[]
14
+ hsh_details= {}
15
+ @org_name.each do |org_name|
16
+ @list_repos=@connection.repos.list(auto_pagination: true,user:org_name)
17
+ @list_repos.map(&:name).each do |repo|
18
+ repo_details=@connection.repos.get(org_name,repo)
19
+ hsh_details[repo]={:description=>repo_details["description"],:url=>repo_details["html_url"],:language=>repo_details["language"]}
20
+ end
21
+ end
22
+ hsh_details
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Gemathon
2
+ VERSION = "0.0.1"
3
+ end
data/lib/gemathon.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "gemathon/version"
2
+ require 'gemathon/list'
3
+
4
+
5
+ module Gemathon
6
+
7
+ end
data/spec/test_spec.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'gemathon'
2
+
3
+
4
+ describe 'gemathon' do
5
+ before(:all) do
6
+ @my_github_username = 'github-contributions'
7
+ @my_github_password = 'github143'
8
+ @connection = Github.new basic_auth: "#{@my_github_username}:#{@my_github_password}"
9
+ @org_name =["check-git",""]
10
+ end
11
+
12
+ it 'list repositories' do
13
+ list = Gemathon::List.new(@connection,@org_name).list
14
+ list.should_not be_nil
15
+ end
16
+ end
17
+
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gemathon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ramtin Vaziri
9
+ - Manish puri
10
+ - Hemali Jain
11
+ - Amruta Das
12
+ - Arpit Kulshrestha
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+ date: 2014-02-25 00:00:00.000000000 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: github_api
20
+ requirement: &74817020 !ruby/object:Gem::Requirement
21
+ none: false
22
+ requirements:
23
+ - - ! '>='
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ type: :runtime
27
+ prerelease: false
28
+ version_requirements: *74817020
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: &74816750 !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ~>
35
+ - !ruby/object:Gem::Version
36
+ version: 10.1.1
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: *74816750
40
+ - !ruby/object:Gem::Dependency
41
+ name: rspec
42
+ requirement: &74816540 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: *74816540
51
+ description: Find repositories belonging to organisation.
52
+ email:
53
+ executables: []
54
+ extensions: []
55
+ extra_rdoc_files: []
56
+ files:
57
+ - .travis.yml
58
+ - Gemfile
59
+ - LICENSE.txt
60
+ - Rakefile
61
+ - Readme.md
62
+ - gemathon.gemspec
63
+ - lib/gemathon.rb
64
+ - lib/gemathon/list.rb
65
+ - lib/gemathon/version.rb
66
+ - spec/test_spec.rb
67
+ homepage: https://github.com/Manik-Ratna/gemathon
68
+ licenses:
69
+ - MIT
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 1.9.3
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 1.8.17
89
+ signing_key:
90
+ specification_version: 3
91
+ summary: gemathon is a Ruby gem that facilittes easy fetching of repositories belonging
92
+ to an organisation
93
+ test_files:
94
+ - spec/test_spec.rb