kick_the_tires 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/kick_the_tires.gemspec +37 -0
- data/lib/kick_the_tires.rb +86 -0
- metadata +109 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3cb8898b70655df647e6740ea327787223b78189
|
4
|
+
data.tar.gz: 746c8ce5fa4e07751a7346f0d7f5f97c01570c7d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d9b655a60edde655c7028b2b0576ed2594cf5d09e6949432230e9331057391cfa9d57486bef9cb20a07e02d2abcc981ebbf32f915864d37d9d8da78e21806b1b
|
7
|
+
data.tar.gz: 29bcadf9a3684ff7ceafb04a30ac6b31829618060afcb517a6fb109c487efd0f272a034fe30c9c2318ef1a6b9adaec18f02cd7c90b4dfc3ccd3643ef3cc0698c
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Dewayne VanHoozer
|
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,65 @@
|
|
1
|
+
# KickTheTires
|
2
|
+
|
3
|
+
Provides some basic methods/assertions that are handy for exploring a new ruby library.
|
4
|
+
|
5
|
+
Sometimes when you hear about a new library/gem you just wat to kick the
|
6
|
+
kick_the_tires to see what it can do. Sometimes you start with some REPL
|
7
|
+
example from the authors or some sample code or tests that the author has
|
8
|
+
provided. This little gem allowed_push_host you to load up a few basic
|
9
|
+
asserts/refutes/shows to explore the library's objects and method results.
|
10
|
+
When you have finished kicking the tires you may want to take the library out
|
11
|
+
for a spin with some functional, application-line code and you don't want
|
12
|
+
any of the tire kicking out to STDOUT.
|
13
|
+
|
14
|
+
It would be a good idea to reuse someone's general purpose assertations library.
|
15
|
+
I did a quick look and didn't find any that were not tightly coupled with a
|
16
|
+
testing framework. Its an API exploration tool to learn the methods and
|
17
|
+
objects introduced by a new gem that you have never seen before.
|
18
|
+
|
19
|
+
You would never buy a used car without first kicking the tires and taking it
|
20
|
+
for a spin. Why would you start using a new gem without playing with it for
|
21
|
+
a while?
|
22
|
+
|
23
|
+
## Installation
|
24
|
+
|
25
|
+
Install it yourself as:
|
26
|
+
|
27
|
+
$ gem install kick_the_tires
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'kick_the_tires'
|
33
|
+
include KickTheTires
|
34
|
+
|
35
|
+
require 'some_new_gem_to_explore'
|
36
|
+
|
37
|
+
sngte = SomeNewGemToExplore.new
|
38
|
+
|
39
|
+
refute sngte.nil?
|
40
|
+
assert_equal SomeNewGemToExplore, sngte.class
|
41
|
+
assert sngte.return_true
|
42
|
+
show sngte
|
43
|
+
|
44
|
+
take_it_for_a_spin # disables all asserts/refutes/shows
|
45
|
+
|
46
|
+
assert sngte.nil? # does nothing but return
|
47
|
+
|
48
|
+
# some application-like code that uses the new gem
|
49
|
+
sngte.each do |s|
|
50
|
+
# do something
|
51
|
+
end
|
52
|
+
|
53
|
+
give_the_keys_back # enables the asserts/regutes/shows
|
54
|
+
|
55
|
+
assert sngte.nil? # active again, will display error stuff if object is not nil
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
## Contributing
|
60
|
+
|
61
|
+
1. Fork it ( https://github.com/[my-github-username]/kick_the_tires/fork )
|
62
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
63
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
64
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
65
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "kick_the_tires"
|
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,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "kick_the_tires"
|
7
|
+
spec.version = '0.0.1'
|
8
|
+
spec.authors = ["Dewayne VanHoozer"]
|
9
|
+
spec.email = ["dvanhoozer@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Provides some basic methods/assertions that are handy for exploring a new ruby library.}
|
12
|
+
spec.description = %q{
|
13
|
+
Sometimes when you hear about a new library/gem you just wat to kick the kick_the_tires
|
14
|
+
to see what it can do. Sometimes you start with some REPL example from the authors
|
15
|
+
or some sample code or tests that the author has provided. This little gem allowed_push_host
|
16
|
+
you to load up a few basic asserts/refutes/shows to explore the library's objects
|
17
|
+
and method results. When you have finished kicking the tires you may want to take
|
18
|
+
the library out for a spin with some functional, application-line code and you
|
19
|
+
don't want any of the tire kicking out to STDOUT.
|
20
|
+
}
|
21
|
+
spec.homepage = "http://github.com/MadBomber/kick_the_tires"
|
22
|
+
spec.license = "You want it? It's yours."
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "bin"
|
26
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
if spec.respond_to?(:metadata)
|
30
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
31
|
+
end
|
32
|
+
|
33
|
+
spec.add_dependency "awesome_print"
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#########################################################
|
3
|
+
###
|
4
|
+
## File: kick_the_tires.rb
|
5
|
+
## Desc: Poke around; check things out; see if you want it
|
6
|
+
## By: Dewayne VanHoozer (dvanhoozer@gmail.com)
|
7
|
+
|
8
|
+
require 'awesome_print'
|
9
|
+
require 'pathname'
|
10
|
+
|
11
|
+
module KickTheTires
|
12
|
+
|
13
|
+
@ktt_disabled = false
|
14
|
+
|
15
|
+
if caller.empty?
|
16
|
+
required_by_filename = __FILE__
|
17
|
+
else
|
18
|
+
required_by_filename = caller.last.split(':').first
|
19
|
+
end
|
20
|
+
|
21
|
+
SOURCE = Pathname.new(required_by_filename).readlines.map{|a_line| a_line.chomp.strip}
|
22
|
+
|
23
|
+
def show_source
|
24
|
+
return if @ktt_disabled
|
25
|
+
puts
|
26
|
+
puts "-"*75
|
27
|
+
a_string = caller.last
|
28
|
+
source_line = a_string.split(' ').first.split(':')[1].to_i
|
29
|
+
puts "Source #=> #{SOURCE[source_line-1]}" # MAGIC: zero-based index
|
30
|
+
end
|
31
|
+
|
32
|
+
def show(a_thing)
|
33
|
+
return if @ktt_disabled
|
34
|
+
show_source
|
35
|
+
puts "Showing #{a_thing.class} #=>"
|
36
|
+
ap a_thing, {indent: 2, raw: true}
|
37
|
+
end
|
38
|
+
|
39
|
+
def assert(a_thing)
|
40
|
+
return if @ktt_disabled
|
41
|
+
assert_equal true, a_thing
|
42
|
+
end
|
43
|
+
|
44
|
+
def refute(a_thing)
|
45
|
+
return if @ktt_disabled
|
46
|
+
assert_equal false, a_thing
|
47
|
+
end
|
48
|
+
|
49
|
+
def assert_equal(expected_this, got_that)
|
50
|
+
return if @ktt_disabled
|
51
|
+
unless expected_this.to_s == got_that.to_s
|
52
|
+
show_source
|
53
|
+
puts 'Result #=>'
|
54
|
+
puts "Expected This: #{expected_this}"
|
55
|
+
puts "But Got That: #{got_that}"
|
56
|
+
puts
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# disable the asserts and shows
|
61
|
+
def take_it_for_a_spin
|
62
|
+
@ktt_disabled = true
|
63
|
+
end
|
64
|
+
|
65
|
+
def give_the_keys_back
|
66
|
+
@ktt_disabled = false
|
67
|
+
end
|
68
|
+
|
69
|
+
def out_for_a_drive?
|
70
|
+
@ktt_disabled
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
# TODO: Need a little more thinking about this
|
75
|
+
# pry currently uses and older version of pry
|
76
|
+
# than cli_helper
|
77
|
+
=begin
|
78
|
+
def hands_on
|
79
|
+
show_source
|
80
|
+
puts "Entering pry. Type 'help' for available commands."
|
81
|
+
puts "Enter the command 'up' to kick the tires on the new ride."
|
82
|
+
binding.pry
|
83
|
+
end
|
84
|
+
=end
|
85
|
+
|
86
|
+
end # module KickTheTires
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kick_the_tires
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dewayne VanHoozer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: awesome_print
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.9'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.9'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: "\n Sometimes when you hear about a new library/gem you just wat to
|
56
|
+
kick the kick_the_tires\n to see what it can do. Sometimes you start with some
|
57
|
+
REPL example from the authors\n or some sample code or tests that the author
|
58
|
+
has provided. This little gem allowed_push_host\n you to load up a few basic
|
59
|
+
asserts/refutes/shows to explore the library's objects\n and method results.
|
60
|
+
\ When you have finished kicking the tires you may want to take\n the library
|
61
|
+
out for a spin with some functional, application-line code and you\n don't
|
62
|
+
want any of the tire kicking out to STDOUT.\n "
|
63
|
+
email:
|
64
|
+
- dvanhoozer@gmail.com
|
65
|
+
executables:
|
66
|
+
- console
|
67
|
+
- setup
|
68
|
+
extensions: []
|
69
|
+
extra_rdoc_files: []
|
70
|
+
files:
|
71
|
+
- ".gitignore"
|
72
|
+
- ".travis.yml"
|
73
|
+
- CODE_OF_CONDUCT.md
|
74
|
+
- Gemfile
|
75
|
+
- LICENSE.txt
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- bin/console
|
79
|
+
- bin/setup
|
80
|
+
- kick_the_tires.gemspec
|
81
|
+
- lib/kick_the_tires.rb
|
82
|
+
homepage: http://github.com/MadBomber/kick_the_tires
|
83
|
+
licenses:
|
84
|
+
- You want it? It's yours.
|
85
|
+
metadata:
|
86
|
+
allowed_push_host: https://rubygems.org
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.4.6
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Provides some basic methods/assertions that are handy for exploring a new
|
107
|
+
ruby library.
|
108
|
+
test_files: []
|
109
|
+
has_rdoc:
|