make_me_a_gem_called 0.0.1

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
+ SHA1:
3
+ metadata.gz: f82daf7134e3c55c3baf9e791a78066b0f4b2753
4
+ data.tar.gz: a38f3d13e178e20c874e77e4e2b0c0477a1ab7ff
5
+ SHA512:
6
+ metadata.gz: aa8340575f734fc5987b4bd00435fd1f4495240501d73177edee4aed91fd6331dc717a0b4aeabfca5c6473f08cb70348b4921383293b846f74a1d35ffdb2e3b0
7
+ data.tar.gz: 87d4957783e5f6c0f8147b1a0e1668d52020cab4598d53878ecd37a025ad963dd2cc186d4765070e6ebba51e688dffa2f2d498d730d1274c52a90a3c6bcf1a19
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in make_me_a_gem_called.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Stephen Giles
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,31 @@
1
+ # MakeMeAGemCalled
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'make_me_a_gem_called'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install make_me_a_gem_called
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/make_me_a_gem_called/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'make_me_a_gem_called'
4
+
5
+ gem = MakeMeAGemCalled.new(ARGV.first)
6
+
7
+ gem.create_with_bundle
8
+ gem.change_into_directory
9
+ gem.create_spec_files
10
+ gem.add_to_spec_files
11
+ gem.add_require_relative_to_main_file
12
+ gem.command_line_question
13
+ gem.create_bin_files if gem.command_line?
14
+ gem.add_to_bin_files if gem.command_line?
15
+ gem.rspec_question
16
+ gem.create_tasks_files if gem.rspec?
17
+ gem.add_to_tasks_files if gem.rspec?
18
+ gem.add_to_rake_file if gem.rspec?
19
+ gem.instructions
@@ -0,0 +1,3 @@
1
+ class MakeMeAGemCalled
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,82 @@
1
+ require_relative "make_me_a_gem_called/version"
2
+
3
+ class MakeMeAGemCalled
4
+
5
+ attr_reader :name, :command_line, :rspec
6
+
7
+ def initialize(name)
8
+ @name = name
9
+ end
10
+
11
+
12
+ def create_with_bundle
13
+ system("bundle gem #{@name}")
14
+ end
15
+
16
+ def change_into_directory
17
+ system("cd #{name}")
18
+ end
19
+
20
+ def create_spec_files
21
+ system("mkdir spec")
22
+ system("touch spec/spec_helper.rb")
23
+ system("touch spec/#{name}_spec.rb")
24
+ end
25
+
26
+ def add_to_spec_files
27
+ system("echo require 'spec_helper' >> spec/#{name}_spec.rb")
28
+ system("echo require '#{name}_spec' >> spec/spec_helper.rb")
29
+ end
30
+
31
+ def add_require_relative_to_main_file
32
+ system("echo require_relative '#{name}/version' >> lib/#{name}.rb")
33
+ end
34
+
35
+ def command_line_question
36
+ "Would you like to run this gem in the command line? Y/N"
37
+ @command_line = gets.chomp
38
+ end
39
+
40
+ def command_line?
41
+ @command_line == 'Y'||'y'||'yes'
42
+ end
43
+
44
+ def rspec_question
45
+ "Would you like to use RSpec to test this gem? Y/N"
46
+ @rspec = gets.chomp
47
+ end
48
+
49
+ def rspec?
50
+ @rspec == 'Y'||'y'||'yes'
51
+ end
52
+
53
+ def create_bin_files
54
+ system("mkdir bin")
55
+ system("touch bin/#{name}")
56
+ end
57
+
58
+ def add_to_bin_files
59
+ system("echo #!/usr/bin/env ruby >> bin/#{name}")
60
+ system("echo require '#{name}' >> bin/#{name}")
61
+ end
62
+
63
+ def create_tasks_files
64
+ system("mkdir tasks")
65
+ system("touch tasks/rspec.rake")
66
+ end
67
+
68
+ def add_to_tasks_files
69
+ system("echo require 'rspec/core/rake_task' >> tasks/rspec.rake")
70
+ system("echo RSpec::Core::RakeTask.new(:spec) >> tasks/rspec.rake")
71
+
72
+ end
73
+
74
+ def add_to_rake_file
75
+ system("echo Dir.glob('tasks/**/*.rake').each(&method(:import)) >> Rakefile")
76
+ end
77
+
78
+ def instructions
79
+ "1. Add spec.add_development_dependency 'rspec' to your gemspec"
80
+ end
81
+
82
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'make_me_a_gem_called/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "make_me_a_gem_called"
8
+ spec.version = MakeMeAGemCalled::VERSION
9
+ spec.authors = ["Stephen Giles"]
10
+ spec.email = [""]
11
+ spec.summary = "This a gem that creates everything you need to make a gem!"
12
+ spec.description = "Having followed a tutorial by Matt Huggins on quickleft.com, I have been building some basic gems. This gem is designed to quickly set up the folder and file structure I like to use. It uses bundler to create the first layer and then I add a few more things on top."
13
+ spec.homepage = ""
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.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+ # spec.add_runtime_dependency "bundler", "~> 1.7"
25
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe MakeMeAGemCalled do
4
+
5
+ let(:gem){MakeMeAGemCalled.new("test_gem")}
6
+
7
+ it 'should take a name when created' do
8
+ expect(gem.name).to eq 'test_gem'
9
+ end
10
+
11
+ it 'should not create without a name passed' do
12
+ expect{MakeMeAGemCalled.new}.to raise_error(ArgumentError)
13
+ end
14
+
15
+ end
@@ -0,0 +1 @@
1
+ require 'make_me_a_gem_called'require test_spec
data/tasks/rspec.rake ADDED
@@ -0,0 +1,2 @@
1
+ require 'rspec/core/rake_task'
2
+ RSpec::Core::RakeTask.new(:spec)
data/test.txt ADDED
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+ unrequire spec_helper
3
+ unrequire spec_helper
4
+
5
+
6
+
7
+ cdc
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: make_me_a_gem_called
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Stephen Giles
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-19 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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Having followed a tutorial by Matt Huggins on quickleft.com, I have been
56
+ building some basic gems. This gem is designed to quickly set up the folder and
57
+ file structure I like to use. It uses bundler to create the first layer and then
58
+ I add a few more things on top.
59
+ email:
60
+ - ''
61
+ executables:
62
+ - make_me_a_gem_called
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - ".gitignore"
67
+ - Gemfile
68
+ - LICENSE.txt
69
+ - README.md
70
+ - Rakefile
71
+ - bin/make_me_a_gem_called
72
+ - lib/make_me_a_gem_called.rb
73
+ - lib/make_me_a_gem_called/version.rb
74
+ - make_me_a_gem_called.gemspec
75
+ - spec/make_me_a_gem_called_spec.rb
76
+ - spec/spec_helper.rb
77
+ - tasks/rspec.rake
78
+ - test.txt
79
+ homepage: ''
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 2.2.2
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: This a gem that creates everything you need to make a gem!
103
+ test_files:
104
+ - spec/make_me_a_gem_called_spec.rb
105
+ - spec/spec_helper.rb