ngb 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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +19 -0
- data/Rakefile +1 -0
- data/bin/ngb +3 -0
- data/lib/ngb.rb +48 -0
- data/lib/ngb/version.rb +3 -0
- data/ngb.gemspec +23 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1864573b41b63e3def1993a6dfe0e8387fae4b92
|
4
|
+
data.tar.gz: 8dd69c854bc80ef88a3f17b604058368f691a324
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 75a25264445df8f399ea09d7e1a197d3caea54be7e3789a77407167b5414df718a0b0faf69ac552fbee3355f2fe9403c4b640aec4fe7bab09b24442226948b81
|
7
|
+
data.tar.gz: 0a6ea55ffc2fac14a7c1a297f6581183018624e2b174a58ef8e2c402e6dc145ef2ff687d4aa61c318e747df225224743c7fdd7c8c88b505ef8222d8c4e78ea61
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 mj
|
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,19 @@
|
|
1
|
+
# Ngb
|
2
|
+
|
3
|
+
> 一个创建和管理golang 项目的工具,具有第三方库的版本控制, 系统需要有ruby的支持
|
4
|
+
|
5
|
+
## install
|
6
|
+
|
7
|
+
`gem install ngb`
|
8
|
+
|
9
|
+
## 使用
|
10
|
+
|
11
|
+
1. 在项目目录加入Packagefile,填入类是下面的内容
|
12
|
+
|
13
|
+
```
|
14
|
+
get "labix.org/v2/mgo/bson"
|
15
|
+
get "github.com/xx/xx"
|
16
|
+
```
|
17
|
+
|
18
|
+
2. 在Packagefile项目所在目录shell 里输入 ngb
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/ngb
ADDED
data/lib/ngb.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require "ngb/version"
|
2
|
+
|
3
|
+
module Ngb
|
4
|
+
|
5
|
+
|
6
|
+
String.class_eval do
|
7
|
+
def black; "\033[30m#{self}\033[0m" end
|
8
|
+
def red; "\033[31m#{self}\033[0m" end
|
9
|
+
def green; "\033[32m#{self}\033[0m" end
|
10
|
+
def brown; "\033[33m#{self}\033[0m" end
|
11
|
+
def blue; "\033[34m#{self}\033[0m" end
|
12
|
+
def magenta; "\033[35m#{self}\033[0m" end
|
13
|
+
def cyan; "\033[36m#{self}\033[0m" end
|
14
|
+
def gray; "\033[37m#{self}\033[0m" end
|
15
|
+
def bg_black; "\033[40m#{self}\033[0m" end
|
16
|
+
def bg_red; "\033[41m#{self}\033[0m" end
|
17
|
+
def bg_green; "\033[42m#{self}\033[0m" end
|
18
|
+
def bg_brown; "\033[43m#{self}\033[0m" end
|
19
|
+
def bg_blue; "\033[44m#{self}\033[0m" end
|
20
|
+
def bg_magenta; "\033[45m#{self}\033[0m" end
|
21
|
+
def bg_cyan; "\033[46m#{self}\033[0m" end
|
22
|
+
def bg_gray; "\033[47m#{self}\033[0m" end
|
23
|
+
def bold; "\033[1m#{self}\033[22m" end
|
24
|
+
def reverse_color; "\033[7m#{self}\033[27m" end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Ngb
|
28
|
+
|
29
|
+
|
30
|
+
def initialize(file_path)
|
31
|
+
`mkdir -p ./src`
|
32
|
+
`mkdir -p ./bin`
|
33
|
+
Ngb.set_env
|
34
|
+
eval(File.read file_path)
|
35
|
+
puts "all is ok".blue
|
36
|
+
end
|
37
|
+
|
38
|
+
def get url
|
39
|
+
puts "install #{url}".green
|
40
|
+
`go get #{url}`
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.set_env
|
44
|
+
ENV['GOPATH'] = Dir.pwd
|
45
|
+
ENV['GOBIN'] = "#{Dir.pwd}/bin"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/ngb/version.rb
ADDED
data/ngb.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ngb/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ngb"
|
8
|
+
spec.version = Ngb::VERSION
|
9
|
+
spec.authors = ["mjason"]
|
10
|
+
spec.email = ["tywf91@gmail.com"]
|
11
|
+
spec.summary = %q{golang package 依赖控制}
|
12
|
+
spec.description = %q{golang package 依赖控制}
|
13
|
+
spec.homepage = "https://github.com/mjason/new_ngb"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
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.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ngb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- mjason
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-14 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.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
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
|
+
description: golang package 依赖控制
|
42
|
+
email:
|
43
|
+
- tywf91@gmail.com
|
44
|
+
executables:
|
45
|
+
- ngb
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- bin/ngb
|
55
|
+
- lib/ngb.rb
|
56
|
+
- lib/ngb/version.rb
|
57
|
+
- ngb.gemspec
|
58
|
+
homepage: https://github.com/mjason/new_ngb
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.2.2
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: golang package 依赖控制
|
82
|
+
test_files: []
|