gitignore-cli 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9f82ec2b974ac7833f10db0b36617fb047e2145d7d4e114f6818532c72b0d8b5
4
+ data.tar.gz: ba94d390600d2692d7f163302c4611aac9f6b400835f494adcf97cf6e9c56bc2
5
+ SHA512:
6
+ metadata.gz: b78383cc183f0a559ab532fa7b5254895893eaa5c3031d3382fc946aa6bea31c53c8e3265873bc9f7477a9b6381ebf15650949d71cc2dc81b6a82cb389bd096b
7
+ data.tar.gz: 550a2126d403735fe334a316657e965029826f883c67fbbd35efcf2439f18b96f540a7a30ecb6d70cd3e85b4f9dbaa55d4029dbbf6f92097fbcd8fef3d191d0a
data/.gitignore ADDED
@@ -0,0 +1,11 @@
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
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.5.3
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in gitignore.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Daniel Vinciguerra
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.
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # AddGitignore
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/add_gitignore`. 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 'add_gitignore'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install add_gitignore
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/dvinciguerra/add_gitignore.
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).
data/Rakefile ADDED
@@ -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
data/bin/gitignore ADDED
@@ -0,0 +1,25 @@
1
+ #!ruby
2
+
3
+ require "gitignore"
4
+
5
+ command = ARGV[0]
6
+
7
+ case command
8
+ when "list"
9
+ Gitignore.list.each do |env|
10
+ puts " - #{env}"
11
+ end
12
+
13
+ when "generate", "g"
14
+ envs = ARGV[1..-1]
15
+ puts Gitignore.generate(envs)
16
+
17
+ else
18
+ puts <<~HELP
19
+ Usage: #{File.basename($0)} [command] [options]
20
+
21
+ Commonly used command are:
22
+ list : list all environment options
23
+ generate : generate a .gitignore file by all environment that you choose
24
+ HELP
25
+ end
@@ -0,0 +1,29 @@
1
+ require_relative 'lib/gitignore/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "gitignore-cli"
5
+ spec.version = Gitignore::VERSION
6
+ spec.authors = ["Daniel Vinciguerra"]
7
+ spec.email = ["daniel.vinciguerra@bivee.com.br"]
8
+
9
+ spec.summary = %q{A ruby cli tool that use gitignore.io to generate your gitignore files}
10
+ spec.description = %q{A ruby cli tool that use gitignore.io to generate your gitignore files}
11
+ spec.homepage = "https://github.com/dvinciguerra/gitignore"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/dvinciguerra/gitignore"
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+
24
+ spec.bindir = "bin"
25
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_runtime_dependency 'http', '~> 4.3', '>= 4.3.0'
29
+ end
data/lib/gitignore.rb ADDED
@@ -0,0 +1,21 @@
1
+ require "gitignore/version"
2
+
3
+ require 'http'
4
+
5
+ module Gitignore
6
+ class Error < StandardError; end
7
+
8
+ class << self
9
+ GITIGNORE_HOST = ENV['GITIGNORE_HOST'] || 'https://www.gitignore.io'
10
+
11
+ def list
12
+ response = HTTP.get("#{GITIGNORE_HOST}/api/list")
13
+ response.body.to_s.gsub(/\n/, ',').split(',')
14
+ end
15
+
16
+ def generate(envs = [])
17
+ response = HTTP.get("#{GITIGNORE_HOST}/api/#{envs.join(',')}")
18
+ response.body.to_s
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module Gitignore
2
+ VERSION = "0.4.0"
3
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitignore-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Vinciguerra
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: http
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 4.3.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '4.3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 4.3.0
33
+ description: A ruby cli tool that use gitignore.io to generate your gitignore files
34
+ email:
35
+ - daniel.vinciguerra@bivee.com.br
36
+ executables:
37
+ - gitignore
38
+ extensions: []
39
+ extra_rdoc_files: []
40
+ files:
41
+ - ".gitignore"
42
+ - ".rspec"
43
+ - ".travis.yml"
44
+ - Gemfile
45
+ - LICENSE.txt
46
+ - README.md
47
+ - Rakefile
48
+ - bin/gitignore
49
+ - gitignore-cli.gemspec
50
+ - lib/gitignore.rb
51
+ - lib/gitignore/version.rb
52
+ homepage: https://github.com/dvinciguerra/gitignore
53
+ licenses:
54
+ - MIT
55
+ metadata:
56
+ homepage_uri: https://github.com/dvinciguerra/gitignore
57
+ source_code_uri: https://github.com/dvinciguerra/gitignore
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.3.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.7.6
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: A ruby cli tool that use gitignore.io to generate your gitignore files
78
+ test_files: []