reclone 0.7.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 150c22dabf68a432bbcda06c08660cf05ae88cbf65d7a2c7d529e13fd8a96250
4
- data.tar.gz: c4b43322667db699ecdf685f54eacae10431c79bea8c54d011f681d0f8fe2465
3
+ metadata.gz: ae2e2867c4f323343ccf1bebd5b0b0f343ae41983a26dc4286d339bae9d71a20
4
+ data.tar.gz: 1fe5b0bdd24cc7786a6513a64b7cc7cfafa4d2680cdae934a421713fb25151ab
5
5
  SHA512:
6
- metadata.gz: b9180e9bf8dec4e3a6ad2a0ee0e14669ba493edc7a1dea767d47ce23de6ae187f6275748f8e0628c0d38afca044f5596c771263d7a2766cfaaaf6647de598f58
7
- data.tar.gz: ce6579800dae5e68b54e347ddbda800410e589886b0ea169eab2bd6c4a8163af2f2b8d89ba1885f7d122e3717866c50508fbeb867a31e19c274ac6dcd9b3ff40
6
+ metadata.gz: b7543a3a12ba632c687da23c0e87d4931b54ff4d363335e81a683f5e17ed46d26e8d52c4008edf2c3a549f463fa8ad5709acbf9b10c0621a38c42be13b209167
7
+ data.tar.gz: ba6bdc0fa6e0417268081a4ce9c27b96906dbc1547a3406fe72f27d789075c6aee9e05f4403d58ba9a7e9b48aebf6fd6e78834ff7f746c283cc7ddd86e23dc63
Binary file
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .env
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.1
6
+ before_install: gem install bundler -v 2.1.4
File without changes
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at dwayne.harmon@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in reclone.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
@@ -0,0 +1,58 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ reclone (1.0.0)
5
+ bundler (~> 2.1.4)
6
+ dotenv (~> 2.7, >= 2.7.6)
7
+ net-ping
8
+ octokit (~> 4.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ coderay (1.1.3)
16
+ diff-lcs (1.4.4)
17
+ dotenv (2.7.6)
18
+ faraday (1.0.1)
19
+ multipart-post (>= 1.2, < 3)
20
+ method_source (1.0.0)
21
+ multipart-post (2.1.1)
22
+ net-ping (2.0.8)
23
+ octokit (4.18.0)
24
+ faraday (>= 0.9)
25
+ sawyer (~> 0.8.0, >= 0.5.3)
26
+ pry (0.13.1)
27
+ coderay (~> 1.1)
28
+ method_source (~> 1.0)
29
+ public_suffix (4.0.5)
30
+ rake (12.3.3)
31
+ rspec (3.9.0)
32
+ rspec-core (~> 3.9.0)
33
+ rspec-expectations (~> 3.9.0)
34
+ rspec-mocks (~> 3.9.0)
35
+ rspec-core (3.9.2)
36
+ rspec-support (~> 3.9.3)
37
+ rspec-expectations (3.9.2)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.9.0)
40
+ rspec-mocks (3.9.1)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.9.0)
43
+ rspec-support (3.9.3)
44
+ sawyer (0.8.2)
45
+ addressable (>= 2.3.5)
46
+ faraday (> 0.8, < 2.0)
47
+
48
+ PLATFORMS
49
+ ruby
50
+
51
+ DEPENDENCIES
52
+ pry
53
+ rake (~> 12.0)
54
+ reclone!
55
+ rspec (~> 3.0)
56
+
57
+ BUNDLED WITH
58
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 dwieb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ # Reclone
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/reclone`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'reclone'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install reclone
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/<github username>/reclone. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<github username>/reclone/blob/master/CODE_OF_CONDUCT.md).
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
+
42
+ ## Code of Conduct
43
+
44
+ Everyone interacting in the Reclone project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<github username>/reclone/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "reclone"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,4 +1,4 @@
1
- require "reclone/version.rb"
1
+ # require "reclone/version.rb"
2
2
 
3
3
 
4
4
  #! Added by moi
@@ -8,7 +8,7 @@ require_relative "reclone/user.rb"
8
8
  require_relative "reclone/octokitty.rb"
9
9
 
10
10
 
11
- require 'pry'
11
+ # require 'pry'
12
12
  # require 'git'
13
13
  require 'octokit'
14
14
  require 'net/ping'
@@ -0,0 +1,65 @@
1
+ class Reclone::CLI
2
+ attr_accessor :current_user
3
+
4
+ def call
5
+ up?
6
+ puts "Hiya friend"; sleep 0.5
7
+ log_in
8
+ recloner
9
+ end
10
+
11
+ # Internet connection check
12
+ def up?
13
+ if Net::Ping::External.new("www.google.com").ping? != true
14
+ puts "You need an internet connection to run this program..."
15
+ puts "As if I needed to tell you that."; sleep 1
16
+ puts "Good bye for now."
17
+ exit
18
+ end
19
+ end
20
+
21
+ def directory_exists?(directory)
22
+ Dir.exists?(directory)
23
+ end
24
+
25
+ def log_in
26
+ puts "Please enter your Github user name."
27
+ user_name = gets.strip.to_s
28
+ @current_user = User.new(user_name)
29
+
30
+ if user_name == "exit"
31
+ exit!
32
+ elsif @current_user.user_info
33
+ puts "Oh hayyy, I found you!"
34
+ else
35
+ puts "I'm having a hard time locating that username."
36
+ puts "Please try again."
37
+ log_in
38
+ end
39
+ end
40
+
41
+ def recloner
42
+ puts "Remember, the next step will clone repositories"
43
+ puts "in your present working directory."
44
+ puts " "
45
+ puts "Make sure you are in the right place before doing the thing."
46
+ puts " "
47
+ puts " "
48
+ puts "Shall I do the thing?"
49
+
50
+ user_input = gets.strip
51
+
52
+ if user_input == "yes"|| user_input == "y" || user_input == 'yis' ||user_input == "yeth"
53
+ current_user.repos.each do |repo|
54
+ if !directory_exists?(repo[:full_name])
55
+ `git clone #{repo[:ssh_url]}`
56
+ end
57
+ end
58
+ elsif user_input == "no"|| user_input == "n" || user_input == "nah"
59
+ puts "Thanks for stopping by, I guess?"
60
+ exit
61
+ else
62
+ recloner
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,27 @@
1
+ class Octokitty
2
+ #! Do I need this class?
3
+ attr_reader :client, :repo_call
4
+
5
+ def initialize
6
+ @client = Octokit::Client.new(access_token: ENV["GIT_PAT"], auto_traversal: true, per_page: 100)
7
+ end
8
+
9
+ def user_config(user_name)
10
+ begin
11
+ user = @client.user(user_name)
12
+ rescue
13
+ user = nil
14
+ end
15
+ user
16
+ end
17
+
18
+ def repo_config(user)
19
+ @client.repos(user, {sort: "created", direction: "desc"})
20
+ end
21
+ end
22
+
23
+ #! Handling 404's from octokit: http://rubylearning.com/satishtalim/ruby_exceptions.html
24
+ #! https://github.com/octokit/octokit.rb#pagination
25
+ #! https://developer.github.com/v3/repos/
26
+ #! https://www.rubydoc.info/github/octokit/octokit.rb/Octokit/Client/Search#search_code-instance_method
27
+ #! http://docs2.lfe.io/guides/traversing-with-pagination/
@@ -0,0 +1,10 @@
1
+ class User
2
+ attr_accessor :username, :user_info, :client, :repos
3
+
4
+ def initialize(name=nil)
5
+ @client = Octokitty.new
6
+ @user_info = @client.user_config(name)
7
+ @repos = @client.repo_config(@user_info.login) if @user_info
8
+ end
9
+
10
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ module Reclone
3
+ VERSION = "0.8.0"
4
+ end
@@ -0,0 +1,3 @@
1
+ querying with graphql:
2
+ https://github.com/github/graphql-client
3
+ https://github.com/simonw/til/blob/master/github/graphql-pagination-python.md
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,36 @@
1
+
2
+ require_relative 'lib/reclone/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "reclone"
6
+ s.version = Reclone::VERSION
7
+ s.summary = %q{Re-clone a few repos. No biggie.}
8
+ s.description = %q{Re-clone your most recent 100 repos from GitHub vis SSH.}
9
+
10
+ s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
11
+
12
+ s.authors = "Dwayne Harmon"
13
+ s.email = "harmon.dwayne@gmail.com"
14
+ s.homepage = "https://github.com/dwyn/reclone"
15
+
16
+ s.license = "MIT"
17
+ s.required_ruby_version = ">= 2.5.0"
18
+ # s.files = ["lib/reclone.rb"]
19
+ s.files = `git ls-files -z`.split("\x0")
20
+ # spec.metadata["homepage_uri"] = spec.homepage
21
+ # spec.metadata["source_code_uri"] = "https://github.com/dwyn/reclone"
22
+ # spec.metadata["changelog_uri"] = "https://github.com/dwyn/reclone/blob/master/CODE_OF_CONDUCT.md"
23
+ s.executables = ["reclone"]
24
+ s.require_paths = ["lib"]
25
+
26
+ s.add_development_dependency "rspec", "~> 3.0"
27
+ s.add_development_dependency "rake", "~> 10.0"
28
+ s.add_development_dependency "pry", '~> 0.13.1'
29
+
30
+ s.add_dependency "net-ping", '~> 2.0', '>= 2.0.8'
31
+ s.add_dependency "octokit", "~> 4.0"
32
+ s.add_dependency "bundler", "~> 2.1.4"
33
+ s.add_dependency "dotenv", '~> 2.7', '>= 2.7.6'
34
+ # spec.add_dependency "clamp"
35
+ # spec.add_dependency "git", '~> 1.3'
36
+ end
@@ -0,0 +1,9 @@
1
+ RSpec.describe Reclone do
2
+ it "has a version number" do
3
+ expect(Reclone::VERSION).not_to be nil
4
+ end
5
+
6
+ it "does something useful" do
7
+ expect(false).to eq(true)
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ require "bundler/setup"
2
+ require "reclone"
3
+
4
+ RSpec.configure do |config|
5
+ # Enable flags like --only-failures and --next-failure
6
+ config.example_status_persistence_file_path = ".rspec_status"
7
+
8
+ # Disable RSpec exposing methods globally on `Module` and `main`
9
+ config.disable_monkey_patching!
10
+
11
+ config.expect_with :rspec do |c|
12
+ c.syntax = :expect
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reclone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dwayne Harmon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-19 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -42,30 +42,36 @@ dependencies:
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.13.1
48
48
  type: :development
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: '0'
54
+ version: 0.13.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: net-ping
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
59
62
  - - ">="
60
63
  - !ruby/object:Gem::Version
61
- version: '0'
64
+ version: 2.0.8
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.0'
66
72
  - - ">="
67
73
  - !ruby/object:Gem::Version
68
- version: '0'
74
+ version: 2.0.8
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: octokit
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -121,8 +127,36 @@ executables:
121
127
  extensions: []
122
128
  extra_rdoc_files: []
123
129
  files:
130
+ - ".DS_Store"
131
+ - ".gitignore"
132
+ - ".rspec"
133
+ - ".travis.yml"
134
+ - CHANGELOG.MD
135
+ - CODE_OF_CONDUCT.md
136
+ - Gemfile
137
+ - Gemfile.lock
138
+ - LICENSE.txt
139
+ - README.md
140
+ - Rakefile
141
+ - bin/console
124
142
  - bin/reclone
143
+ - bin/setup
125
144
  - lib/reclone.rb
145
+ - lib/reclone/cli.rb
146
+ - lib/reclone/octokitty.rb
147
+ - lib/reclone/user.rb
148
+ - lib/reclone/version.rb
149
+ - notes.md
150
+ - reclone-0.1.0.gem
151
+ - reclone-0.2.0.gem
152
+ - reclone-0.3.0.gem
153
+ - reclone-0.4.0.gem
154
+ - reclone-0.5.0.gem
155
+ - reclone-0.6.0.gem
156
+ - reclone-0.7.0.gem
157
+ - reclone.gemspec
158
+ - spec/reclone_spec.rb
159
+ - spec/spec_helper.rb
126
160
  homepage: https://github.com/dwyn/reclone
127
161
  licenses:
128
162
  - MIT