gemcon 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b514b26f4cf2d87d9ed9e213997204010543801c
4
+ data.tar.gz: 8fe73e6550ae6332932c870dd1fa3c725175bf8d
5
+ SHA512:
6
+ metadata.gz: ee93a2aa8737148f2eb8c7da15817623ed561a121d98758c3fc466bf70531b6f075b18b3fc78b2a9e1c29cc091e385a4802b93aeddeee64261e70ed284b3738f
7
+ data.tar.gz: 236571198acbecfebd32a2ecc77eb4aaa77056cd631a06fb196fb9b92f22c41e04962141194f5bbb4d308a9e68e1e62d53012baf659052e2885fb52305883d0d
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /vendor/
11
+ *.gem
@@ -0,0 +1,8 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.9
6
+ - 2.2.0
7
+ - 2.3.1
8
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at iisowrovii@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gemcon.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ # MIT License (MIT)
2
+
3
+ *__Copyright (c) 2016 Zahidul Haque__*
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,41 @@
1
+ # Gemcon [![Build Status](https://travis-ci.org/opodartho/gemcon.svg?branch=master)](https://travis-ci.org/opodartho/gemcon) [![Code Climate](https://codeclimate.com/github/opodartho/gemcon/badges/gpa.svg)](https://codeclimate.com/github/opodartho/gemcon) [![Issue Count](https://codeclimate.com/github/opodartho/gemcon/badges/issue_count.svg)](https://codeclimate.com/github/opodartho/gemcon)
2
+
3
+ Simple ruby console application generator.
4
+
5
+ ## Installation
6
+
7
+ Install it by running:
8
+ ```bash
9
+ $ gem install gemcon
10
+ ```
11
+ Check your installation:
12
+ ```bash
13
+ $ gemcon -v
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```bash
19
+ $ gemcon new example_app
20
+ ```
21
+ For help:
22
+ ```bash
23
+ $ gemcon help
24
+ ```
25
+
26
+ ## Contributing
27
+
28
+ We love getting feedback with or without pull requests. If you do add a new
29
+ feature, please add tests so that we can avoid breaking it in the future.
30
+
31
+ Speaking of tests, we use `minitest`, which can be run by executing the following
32
+ from the root directory of the repository:
33
+
34
+ ```bash
35
+ bundle exec rake
36
+ ```
37
+
38
+ ## License
39
+
40
+ This project is released under the [MIT license](LICENSE.md).
41
+
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task default: :test
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'gemcon'
5
+
6
+ require 'pry'
7
+ Pry.start
@@ -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
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby -*-
3
+
4
+ require 'bundler/setup'
5
+ require 'gemcon'
6
+ Gemcon::Cli.start
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gemcon/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'gemcon'
8
+ spec.version = Gemcon::VERSION
9
+ spec.authors = ['Zahidul Haque']
10
+ spec.email = ['iisowrovii@gmail.com']
11
+
12
+ spec.summary = 'Simple console app generator for testing gems.'
13
+ spec.homepage = 'https://github.com/opodartho/gemcon'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+
20
+ spec.bindir = 'exe'
21
+ spec.executables = ['gemcon']
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.required_ruby_version = '>= 2.0.0'
25
+ spec.add_runtime_dependency 'thor', '>=0.18.1', '< 2.0'
26
+
27
+ spec.add_development_dependency 'bundler', '~> 1.12'
28
+ spec.add_development_dependency 'rake', '~> 10.0'
29
+ spec.add_development_dependency 'minitest', '~> 5.0'
30
+ spec.add_development_dependency 'fakefs', '~> 0.6.0'
31
+ spec.add_development_dependency 'rubocop', '~> 0.42'
32
+ spec.add_development_dependency 'pry', '~> 0.10'
33
+ end
@@ -0,0 +1,6 @@
1
+ require 'pathname'
2
+ require 'gemcon/cli'
3
+ require 'gemcon/version'
4
+ # empty gem module
5
+ module Gemcon
6
+ end
@@ -0,0 +1,48 @@
1
+ require 'thor'
2
+ module Gemcon
3
+ # Gemcon Cli define tasks using thor
4
+ class Cli < Thor
5
+ include Thor::Actions
6
+
7
+ desc 'new [APP_NAME]', 'Generate a simple console application'
8
+ option :ruby, aliases: '-r'
9
+ def new(app_name = nil)
10
+ raise Error, 'Usage: gemcon new [APP_NAME]' if app_name.nil?
11
+ path = File.expand_path(app_name)
12
+ raise(
13
+ Error,
14
+ set_color("ERROR: #{path} already exists.", :red)
15
+ ) if File.exist?(path)
16
+
17
+ @app_name = app_name
18
+ generate
19
+ end
20
+
21
+ desc 'version', 'Display version'
22
+ map %w(-v --version) => :version
23
+
24
+ def version
25
+ say "Gemcon #{VERSION}"
26
+ end
27
+
28
+ private
29
+
30
+ def generate
31
+ template('Gemfile.tt', 'Gemfile')
32
+ template('app/project.tt', "app/#{@app_name}.rb")
33
+ template('config/boot.tt', 'config/boot.rb')
34
+ template('bin/console', 'bin/console')
35
+ chmod "#{@app_name}/bin/console", 0o755
36
+ end
37
+
38
+ def template(template, filename)
39
+ super(template, "#{@app_name}/#{filename}")
40
+ end
41
+
42
+ class << self
43
+ def source_root
44
+ Pathname.new(__FILE__).join('../../../templates')
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,3 @@
1
+ module Gemcon
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+ <%= "ruby '#{options[:ruby]}'\n" if options.has_key?('ruby') %>
3
+ gem 'pry'
@@ -0,0 +1 @@
1
+ # require all project related files here
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+
5
+ ENV['BUNDLE_GEMFILE'] ||=
6
+ File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
7
+ require 'rubygems'
8
+ require 'bundler/setup'
9
+ require_relative '../config/boot'
10
+
11
+ load Gem.bin_path('pry', 'pry')
@@ -0,0 +1 @@
1
+ require_relative '../app/<%= @app_name %>'
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gemcon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Zahidul Haque
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.18.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.18.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.12'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.12'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '5.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: fakefs
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 0.6.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 0.6.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.42'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.42'
103
+ - !ruby/object:Gem::Dependency
104
+ name: pry
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.10'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.10'
117
+ description:
118
+ email:
119
+ - iisowrovii@gmail.com
120
+ executables:
121
+ - gemcon
122
+ extensions: []
123
+ extra_rdoc_files: []
124
+ files:
125
+ - ".gitignore"
126
+ - ".travis.yml"
127
+ - CODE_OF_CONDUCT.md
128
+ - Gemfile
129
+ - LICENSE.md
130
+ - README.md
131
+ - Rakefile
132
+ - bin/console
133
+ - bin/setup
134
+ - exe/gemcon
135
+ - gemcon.gemspec
136
+ - lib/gemcon.rb
137
+ - lib/gemcon/cli.rb
138
+ - lib/gemcon/version.rb
139
+ - templates/Gemfile.tt
140
+ - templates/app/project.tt
141
+ - templates/bin/console
142
+ - templates/config/boot.tt
143
+ homepage: https://github.com/opodartho/gemcon
144
+ licenses:
145
+ - MIT
146
+ metadata: {}
147
+ post_install_message:
148
+ rdoc_options: []
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: 2.0.0
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ requirements: []
162
+ rubyforge_project:
163
+ rubygems_version: 2.6.6
164
+ signing_key:
165
+ specification_version: 4
166
+ summary: Simple console app generator for testing gems.
167
+ test_files: []