anything-gorepo 0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c5df0f856789b5baf54437999320d50e11189b0d
4
+ data.tar.gz: 8a74772ded9508652f31dec4cc0d0cf8282e2f0a
5
+ SHA512:
6
+ metadata.gz: 63be75a1f6e4ecb2c5d4e7b74761f598e7ed37152c15f0a09e613606ab693ba80a5eef0cd1d62db0b363e8403c4e9596d0b1d12d5478c36d3969de042292e3b9
7
+ data.tar.gz: dbcc1cf1a93e3ad3b9365c7b8135373fa6755e0bae5ee9e2eff078ec2c7abb94c928512c7c3cf66600d3342a0a2f6373036d2659756e5caf8c3aa3ae9b865cb5
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in anything-gorepo.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Takatoshi Matsumoto
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/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # AnythingGorepo
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ gem 'anything-gorepo'
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install anything-gorepo
16
+
17
+ ## Usage
18
+
19
+ $ cd $(anything-gorepo)
20
+
21
+ ## Contributing
22
+
23
+ 1. Fork it
24
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
25
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
26
+ 4. Push to the branch (`git push origin my-new-feature`)
27
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -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 'anything-gorepo/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "anything-gorepo"
8
+ spec.version = AnythingGorepo::VERSION
9
+ spec.authors = ["Takatoshi Matsumoto"]
10
+ spec.email = ["toqoz403@gmail.com"]
11
+ spec.description = %q{Find local go repositories in $GOPATH by anything interface.}
12
+ spec.summary = %q{People who are tired of finding a golang repository in local! This is solution for it.}
13
+ spec.homepage = "http://github.com/ToQoz/anything-gorepo"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_dependency "ruby-anything", ">= 0.0.4"
25
+ end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ root = File.expand_path('../..', __FILE__)
4
+ $LOAD_PATH.unshift root
5
+ $LOAD_PATH.unshift File.join(root, 'lib')
6
+
7
+ require 'anything-gorepo'
8
+
9
+ unless ENV['GOPATH']
10
+ STDERR.puts '$GOPATH should not be empty'
11
+ exit 1
12
+ end
13
+
14
+ require 'ruby-anything'
15
+
16
+ gopath = ENV['GOPATH'].dup
17
+
18
+ unless gopath
19
+ STDERR.puts e.message
20
+ exit 1
21
+ end
22
+
23
+ STDOUT.puts AnythingGorepo.find(File.join(gopath, 'src'))
@@ -0,0 +1,28 @@
1
+ module AnythingGorepo
2
+ class Finder
3
+ def initialize src
4
+ @repo_paths = []
5
+ directories(src).each do |host|
6
+ directories(File.join(src, host)).each do |user|
7
+ directories(File.join(src, host, user)).each do |repo|
8
+ @repo_paths << File.join(host, user, repo) # diplay without src
9
+ end
10
+ end
11
+ end
12
+ end
13
+
14
+ def find
15
+ _anything_(@repo_paths)
16
+ end
17
+
18
+ private
19
+
20
+ def directories path
21
+ Dir.entries(path).select do |filename|
22
+ File.directory?(File.join(path, filename))
23
+ end.select do |filename|
24
+ filename != '.' && filename != '..'
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module AnythingGorepo
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,8 @@
1
+ require "anything-gorepo/version"
2
+ require "anything-gorepo/finder"
3
+
4
+ module AnythingGorepo
5
+ def self.find src
6
+ File.join(src, Finder.new(src).find)
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: anything-gorepo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Takatoshi Matsumoto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-anything
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.4
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.4
55
+ description: Find local go repositories in $GOPATH by anything interface.
56
+ email:
57
+ - toqoz403@gmail.com
58
+ executables:
59
+ - anything-gorepo
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - anything-gorepo.gemspec
69
+ - bin/anything-gorepo
70
+ - lib/anything-gorepo.rb
71
+ - lib/anything-gorepo/finder.rb
72
+ - lib/anything-gorepo/version.rb
73
+ homepage: http://github.com/ToQoz/anything-gorepo
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.0.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: People who are tired of finding a golang repository in local! This is solution
97
+ for it.
98
+ test_files: []
99
+ has_rdoc: