bundle-star 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5b9916fa30e6208afb0bc3b51d80bbb5eef8bd3
4
- data.tar.gz: ce3c346fc5c2835528bf0bc15770780bee4d7131
3
+ metadata.gz: 36f4f653353973873c1048d6f3ac185cebe9b67d
4
+ data.tar.gz: c1ffe6e1612fb322becd3a87280110c5b4a0f9ab
5
5
  SHA512:
6
- metadata.gz: d16e3f07d080f525f91233fb531a88fe1e309dfcd82adc3647e55678f7fc91e7120ab30c01f588dbb8a06f37f6bd42e37c818fcb63404ff41448240cefd93b67
7
- data.tar.gz: d629ec3c7605eef924b5f41b064b6d17bd343231a2ef1769f93d774cce9f05e4329766412dec414f86067ceac11b1c9dc8f06dda28a5d7d0441978ed7292f0d8
6
+ metadata.gz: 0e2ffaf48e61116bb9b11ce4f305d98d6074f528d431f4a794ccc9102a5f5a8269bccb99d734bf0b6a0310b295205d3210d0ef4dc25eee67626f920c350bc551
7
+ data.tar.gz: 7a5a9c03fe2aa84e74228bb74f23f19408452fd26bde4a007466a6b38369b5ee1edd27281ca90ce8e9dbdf810d41ee47e9159c5c8e188a64c9a54854ceeec81a
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  [![Stories in Ready](https://badge.waffle.io/ma2gedev/bundle-star.png?label=ready)](https://waffle.io/ma2gedev/bundle-star)
2
2
  # Bundle-star
3
3
 
4
- Bundle-star starred gem's github repository when `bundle-star install`ed
4
+ Bundle-star starred gem's github repository when bundle installing by `bundle-star` command.
5
+
6
+ ![Demo](https://github.com/ma2gedev/bundle-star/raw/master/try-bundle-star.gif)
5
7
 
6
8
  See Also my slide for M3 TechTalk https://speakerdeck.com/ma2gedev/bundle-star-how-to-appreciate-oss-projects
7
9
 
@@ -18,7 +20,7 @@ Install it yourself as:
18
20
  Bundle-star depends on Netrc gem and Octokit gem to access GitHub API.
19
21
  Write your GitHub credentials into `.netrc` file(locating to `~/.netrc`), you can now access to GitHub API by bundle-star command.
20
22
 
21
- The following is a sample `.netrc` file.
23
+ The following is a sample `.netrc` file. And execute `chmod 600 ~/.netrc` to avoid permission error.
22
24
 
23
25
  ```
24
26
  machine api.github.com
@@ -31,31 +33,6 @@ machine api.github.com
31
33
  $ bundle-star install
32
34
  $ bundle-star update
33
35
 
34
- ### Example
35
-
36
- $ echo "source 'https://rubygems.org'" >> Gemfile
37
- $ echo "gem 'bundle-star'" >> Gemfile
38
- $ bundle-star install --path vendor/bundle
39
- Fetching gem metadata from https://rubygems.org/............
40
- Fetching gem metadata from https://rubygems.org/..
41
- Resolving dependencies...
42
- Installing addressable (2.3.5)
43
- Using bundler (1.4.0.pre.2)
44
- starred geemus/netrc <------ starred
45
- Installing netrc (0.7.7)
46
- starred nicksieger/multipart-post <------ starred
47
- Installing multipart-post (1.2.0)
48
- starred lostisland/faraday <------ starred
49
- Installing faraday (0.8.8)
50
- starred lostisland/sawyer <------ starred
51
- Installing sawyer (0.5.1)
52
- starred octokit/octokit.rb <------ starred
53
- Installing octokit (2.6.0)
54
- starred ma2gedev/bundle-star <------ starred
55
- Installing bundle-star (1.0.0)
56
- Your bundle is complete!
57
- It was installed into ./vendor/bundle
58
-
59
36
  ### Pro tip:
60
37
 
61
38
  alias bsi="bundle-star install"
@@ -67,3 +44,14 @@ machine api.github.com
67
44
  3. Commit your changes (`git commit -am 'Add some feature'`)
68
45
  4. Push to the branch (`git push origin my-new-feature`)
69
46
  5. Create new Pull Request
47
+
48
+ ## Development
49
+
50
+ ### DEBUG environment variable
51
+
52
+ It is useful for develop with DEBUG environment variable like the following:
53
+
54
+ ```
55
+ DEBUG=true bin/bundle-star
56
+ ```
57
+
@@ -1,8 +1,34 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "rubygems"
4
+ require "netrc"
5
+ require "io/console"
6
+ require "fileutils"
4
7
  require "octokit"
5
8
 
9
+ GITHUB_HOST = "api.github.com".freeze
10
+ netrc = Netrc.read
11
+ github_account = netrc[GITHUB_HOST]
12
+ unless github_account
13
+ src_path = Netrc.default_path
14
+ puts "Not found your GitHub ID/Token. Please input your GitHub ID and Token if you ok, bundle-star will save these information to netrc file: "
15
+
16
+ puts "Input GitHub ID"
17
+ github_id = STDIN.gets.chomp
18
+ puts "Input GitHub Token"
19
+ github_token = STDIN.noecho(&:gets).chomp
20
+
21
+ if netrc.length > 0
22
+ dest_path = "#{Netrc.default_path}.backup_by_bundlestar"
23
+ FileUtils.cp src_path, dest_path
24
+ puts "Your original netrc file is copied to #{dest_path}"
25
+ end
26
+
27
+ netrc[GITHUB_HOST] = github_id, github_token
28
+ netrc.save
29
+ puts "Saved to #{src_path}"
30
+ end
31
+
6
32
  module Bundler
7
33
  class Star
8
34
  attr_reader :installer
@@ -20,7 +46,8 @@ module Bundler
20
46
  message << (macos_higher_lion? ? "\xe2\xad\x90 " : "\xe2\x98\x85 ")
21
47
  puts message + "starred #{repo} (^_^)b\e[0m"
22
48
  rescue => e
23
- puts "\e[31mfailed starring #{repo}, reason #{e}\e[0m"
49
+ puts "\e[31mfailed putting a star #{repo}, reason #{e}\e[0m"
50
+ puts e.backtrace if ENV['DEBUG']
24
51
  end
25
52
  end
26
53
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "bundle-star"
7
- spec.version = "1.0.2"
7
+ spec.version = "1.0.3"
8
8
  spec.authors = ["Takayuki Matsubara"]
9
9
  spec.email = ["takayuki.1229@gmail.com"]
10
10
  spec.description = %q{Star github repositories automatically when you `bundle-star install`ed}
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency "bundler"
21
21
  spec.add_dependency "netrc"
22
- spec.add_dependency "octokit", "~> 2.0"
22
+ spec.add_dependency "octokit", "~> 4.0"
23
23
 
24
24
  spec.add_development_dependency "rake"
25
25
  end
Binary file
Binary file
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundle-star
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takayuki Matsubara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-26 00:00:00.000000000 Z
11
+ date: 2017-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: netrc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '4.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Star github repositories automatically when you `bundle-star install`ed
@@ -74,13 +74,15 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - .gitignore
77
+ - ".gitignore"
78
78
  - Gemfile
79
79
  - LICENSE.txt
80
80
  - README.md
81
81
  - Rakefile
82
82
  - bin/bundle-star
83
83
  - bundle-star.gemspec
84
+ - exec_bundle-star.png
85
+ - try-bundle-star.gif
84
86
  homepage: https://github.com/ma2gedev/bundle-star
85
87
  licenses:
86
88
  - MIT
@@ -91,17 +93,17 @@ require_paths:
91
93
  - lib
92
94
  required_ruby_version: !ruby/object:Gem::Requirement
93
95
  requirements:
94
- - - '>='
96
+ - - ">="
95
97
  - !ruby/object:Gem::Version
96
98
  version: '0'
97
99
  required_rubygems_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
- - - '>='
101
+ - - ">="
100
102
  - !ruby/object:Gem::Version
101
103
  version: '0'
102
104
  requirements: []
103
105
  rubyforge_project:
104
- rubygems_version: 2.0.3
106
+ rubygems_version: 2.6.11
105
107
  signing_key:
106
108
  specification_version: 4
107
109
  summary: Star github repositories automatically when you `bundle-star install`ed