cargem 0.1.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
+ SHA1:
3
+ metadata.gz: 4d52b3f420b75858d98ddeaf771f032854b13852
4
+ data.tar.gz: a2f65448e5e6224a51ef6707d4f31c96268ed409
5
+ SHA512:
6
+ metadata.gz: 7ae5a9c83d52c4854ae27eb2e252d5635e468769dd50d08be369c7992b96bc484262d83544849a187980d14ed752be8be476d53af9281bfc95dcbdfde655413f
7
+ data.tar.gz: 2dbb8080ba11a63833b9e8357b242ffbd61fe2355aef8f9547aa144954fe90ca45e7028295abf44ef1bd14f6219f9743adc5709503282447f39816cd270530cc
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,9 @@
1
+ image: ruby:2.3.1
2
+
3
+ before_script:
4
+ - gem install bundler
5
+ - bundle install
6
+
7
+ test:
8
+ script:
9
+ - bundle exec rspec
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in camaro.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,44 @@
1
+ guard :rspec, cmd: "bundle exec rspec" do
2
+ require "guard/rspec/dsl"
3
+ dsl = Guard::RSpec::Dsl.new(self)
4
+
5
+ # Feel free to open issues for suggestions and improvements
6
+
7
+ # RSpec files
8
+ rspec = dsl.rspec
9
+ watch(rspec.spec_helper) { rspec.spec_dir }
10
+ watch(rspec.spec_support) { rspec.spec_dir }
11
+ watch(rspec.spec_files)
12
+
13
+ # Ruby files
14
+ ruby = dsl.ruby
15
+ dsl.watch_spec_files_for(ruby.lib_files)
16
+
17
+ # Rails files
18
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
19
+ dsl.watch_spec_files_for(rails.app_files)
20
+ dsl.watch_spec_files_for(rails.views)
21
+
22
+ watch(rails.controllers) do |m|
23
+ [
24
+ rspec.spec.call("routing/#{m[1]}_routing"),
25
+ rspec.spec.call("controllers/#{m[1]}_controller"),
26
+ rspec.spec.call("acceptance/#{m[1]}")
27
+ ]
28
+ end
29
+
30
+ # Rails config changes
31
+ watch(rails.spec_helper) { rspec.spec_dir }
32
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
33
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
34
+
35
+ # Capybara features specs
36
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
37
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
38
+
39
+ # Turnip features and steps
40
+ watch(%r{^spec/acceptance/(.+)\.feature$})
41
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
42
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
43
+ end
44
+ end
data/README.md ADDED
@@ -0,0 +1,12 @@
1
+ ## What does CarGem do?
2
+
3
+ CarGem allows the author of a ruby script to instantiate convieniently configured Car objects in various versions.
4
+
5
+ Here's an example use, where we generate a Camaro and tell it to drive.
6
+
7
+ `irb> require 'cargem' && Camaro.new.drive `
8
+
9
+ ### Class methods
10
+
11
+ * `Camaro#accelerate # Increments current_speed by 1`
12
+ * `Camaro#drive # Drive calls accelerate until it hits max speed`
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |task|
5
+ task.rspec_opts = ['--color', '--format', 'nested']
6
+ end
7
+
8
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cargem"
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
data/bin/setup ADDED
@@ -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
data/cargem.gemspec ADDED
@@ -0,0 +1,41 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cargem/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cargem"
8
+ spec.version = Cargem::VERSION
9
+ spec.authors = ["Keifer Furzland"]
10
+ spec.email = ["kfrz.code@gmail.com"]
11
+
12
+ spec.summary = %q{"This is a simple car-generation gem"}
13
+ spec.description = %q{"This is meant to be an example of how to build a simple Ruby gem."}
14
+ spec.homepage = "https://github.com/kfrz/cargem"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against " \
22
+ "public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.13"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "rspec-nc"
36
+ spec.add_development_dependency "guard"
37
+ spec.add_development_dependency "guard-rspec"
38
+ spec.add_development_dependency "pry"
39
+ spec.add_development_dependency "pry-remote"
40
+ spec.add_development_dependency "pry-nav"
41
+ end
@@ -0,0 +1,10 @@
1
+ module Cargem
2
+ class Camaro < Car
3
+ def initialize
4
+ super
5
+ @make = "Chevy"
6
+ @model = "Camaro"
7
+ @max_speed = 200
8
+ end
9
+ end
10
+ end
data/lib/cargem/car.rb ADDED
@@ -0,0 +1,42 @@
1
+ module Cargem
2
+ class Car
3
+ def initialize
4
+ @make = "unknown"
5
+ @model = "unknown"
6
+ @max_speed = 0
7
+ @current_speed = 0
8
+ end
9
+
10
+ def accelerate
11
+ @current_speed += 1
12
+ end
13
+
14
+ def brand
15
+ @make + @model
16
+ end
17
+
18
+ def current_speed
19
+ @current_speed
20
+ end
21
+
22
+ def drive
23
+ while @current_speed <= @max_speed
24
+ puts "#{@current_speed}"
25
+ accelerate
26
+ end
27
+ print "The #{@make} #{@model} has hit its max speed of #{@max_speed} and will now stop accelerating."
28
+ end
29
+
30
+ def make
31
+ @make
32
+ end
33
+
34
+ def model
35
+ @model
36
+ end
37
+
38
+ def max_speed
39
+ @max_speed
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,7 @@
1
+ class Camaro < Car
2
+ def initialize
3
+ super
4
+ @brand = "Chevy"
5
+ @max_speed = 200
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Cargem
2
+ VERSION = "0.1.0"
3
+ end
data/lib/cargem.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "cargem/version"
2
+ require "cargem/car"
3
+ require "cargem/camaro"
4
+
5
+ module Cargem
6
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cargem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Keifer Furzland
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-11-08 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.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
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: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-nc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry-remote
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-nav
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: '"This is meant to be an example of how to build a simple Ruby gem."'
140
+ email:
141
+ - kfrz.code@gmail.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - ".gitlab-ci.yml"
148
+ - ".rspec"
149
+ - Gemfile
150
+ - Guardfile
151
+ - README.md
152
+ - Rakefile
153
+ - bin/console
154
+ - bin/setup
155
+ - cargem.gemspec
156
+ - lib/cargem.rb
157
+ - lib/cargem/camaro.rb
158
+ - lib/cargem/car.rb
159
+ - lib/cargem/cargem.rb
160
+ - lib/cargem/version.rb
161
+ homepage: https://github.com/kfrz/cargem
162
+ licenses: []
163
+ metadata:
164
+ allowed_push_host: https://rubygems.org
165
+ post_install_message:
166
+ rdoc_options: []
167
+ require_paths:
168
+ - lib
169
+ required_ruby_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ requirements: []
180
+ rubyforge_project:
181
+ rubygems_version: 2.5.1
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: '"This is a simple car-generation gem"'
185
+ test_files: []