freakin 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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +21 -0
- data/.travis.yml +15 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +71 -0
- data/Rakefile +13 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/freakin +5 -0
- data/freakin.gemspec +36 -0
- data/lib/freakin/translator.rb +30 -0
- data/lib/freakin/version.rb +3 -0
- data/lib/freakin.rb +25 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 96be23895a633ea329593d762b32cfe80827578a
|
4
|
+
data.tar.gz: 33d513e75544b5bb035ece46f20f1c702c2fd94d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 27b83837d3dfdcac95c332af5f092da8ac973e2a10d84c19916c7e4005b6ea0a7f4510fe1c65af559f4b2fec0f9c6a1c82464b112dd1b0149378e58b5a7c8474
|
7
|
+
data.tar.gz: a71d74057947f2355b9931a505ca92b1274f9b659954f8da54a110619aa07fa34207b052c78be795ea9d3cbf6eaa4c8e7eede39582603ad04453665d909bba94
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
# Bin contains standard files created when gem is initialised and therefore they should be left as is
|
4
|
+
- 'bin/**/*'
|
5
|
+
# Exe contains standard files created when gem is initialised and therefore they should be left as is
|
6
|
+
- 'exe/**/*'
|
7
|
+
# Rakefile is generated when gem is initialised and therefore should be left as is
|
8
|
+
- 'Rakefile'
|
9
|
+
# Gemfile is generated when gem is initialised and therefore should be left as is
|
10
|
+
- 'Gemfile'
|
11
|
+
# Cop names are not displayed in offense messages by default. We find it useful to include this information so we can
|
12
|
+
# use it to investigate what the fix may be.
|
13
|
+
DisplayCopNames: true
|
14
|
+
# Style guide URLs are not displayed in offense messages by default. Again we find it useful to go straight to the
|
15
|
+
# documentation for a rule when investigating what the fix may be.
|
16
|
+
DisplayStyleGuide: true
|
17
|
+
|
18
|
+
# Disable this rubocop style because we want to make the arguments passed into quke available to anywhere when the code
|
19
|
+
# is executed rubocop:disable Style/GlobalVars
|
20
|
+
Style/GlobalVars:
|
21
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 2.3.1
|
5
|
+
before_install: gem install bundler -v 1.12.5
|
6
|
+
|
7
|
+
# Travis CI clones repositories to a depth of 50 commits, which is only really
|
8
|
+
# useful if you are performing git operations.
|
9
|
+
# https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth
|
10
|
+
git:
|
11
|
+
depth: 3
|
12
|
+
|
13
|
+
# enable Bundler caching
|
14
|
+
# https://docs.travis-ci.com/user/languages/ruby#Caching-Bundler
|
15
|
+
cache: bundler
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Alan Cruikshanks
|
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,71 @@
|
|
1
|
+
# Freakin
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/freakin)
|
4
|
+
|
5
|
+
This gem is ***freakin awesome*** in that it does nothing useful! It is purely an exercise in me getting to grips with creating an executable gem.
|
6
|
+
|
7
|
+
> 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/freakin`. To experiment with that code, run `bin/console` for an interactive prompt.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
### Actual installation
|
12
|
+
|
13
|
+
As **Freakin** has not yet been released to Rubygems the out of the box installation notes below won't work, but are preserved for when this does get released.
|
14
|
+
|
15
|
+
To install the gem having cloned the directory execute
|
16
|
+
|
17
|
+
$ bundle exec rake install
|
18
|
+
|
19
|
+
### Standard installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'freakin'
|
25
|
+
```
|
26
|
+
|
27
|
+
And then execute
|
28
|
+
|
29
|
+
$ bundle
|
30
|
+
|
31
|
+
Or install it yourself as
|
32
|
+
|
33
|
+
$ gem install freakin
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
### Development
|
38
|
+
|
39
|
+
Whilst just developing a gem like **Freakin** you can execute it with
|
40
|
+
|
41
|
+
$ ruby -Ilib ./exe/freakin
|
42
|
+
|
43
|
+
and pass in arguments as well
|
44
|
+
|
45
|
+
$ ruby -Ilib ./exe/freakin 'spanish'
|
46
|
+
|
47
|
+
### Actual
|
48
|
+
|
49
|
+
Once installed you can just call
|
50
|
+
|
51
|
+
$ bundle exec freakin
|
52
|
+
|
53
|
+
and
|
54
|
+
|
55
|
+
$ bundle exec freakin 'spanish'
|
56
|
+
|
57
|
+
## Development
|
58
|
+
|
59
|
+
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.
|
60
|
+
|
61
|
+
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).
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cruikshanks/freakin.
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
70
|
+
|
71
|
+
> If you don't add a license it's neither free or open!
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rdoc/task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
|
7
|
+
RDoc::Task.new do |doc|
|
8
|
+
doc.main = 'README.md'
|
9
|
+
doc.title = 'Freakin'
|
10
|
+
doc.rdoc_files = FileList.new %w[README.md lib LICENSE.txt]
|
11
|
+
end
|
12
|
+
|
13
|
+
task :default => :spec
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "freakin"
|
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
data/exe/freakin
ADDED
data/freakin.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'freakin/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'freakin'
|
8
|
+
spec.version = Freakin::VERSION
|
9
|
+
spec.authors = ['Alan Cruikshanks']
|
10
|
+
spec.email = ['alan.cruikshanks@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'A freakin awesome gem'
|
13
|
+
spec.description = 'A freakin awesome gem that does nothing, awesomely!'
|
14
|
+
spec.homepage = 'https://github.com/cruikshanks/freakin'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the
|
18
|
+
# 'allowed_push_host' to allow pushing to a single host or delete this section
|
19
|
+
# to allow pushing to any host.
|
20
|
+
if spec.respond_to?(:metadata)
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
|
22
|
+
else
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect /
|
24
|
+
against public gem pushes.'
|
25
|
+
end
|
26
|
+
|
27
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
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.12'
|
33
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
spec.add_development_dependency 'rdoc', '~> 4.2'
|
36
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Freakin #:nodoc:
|
2
|
+
# An instance of +Translator+ will determine what greeting to return based
|
3
|
+
# on the language selected when its instantiated
|
4
|
+
class Translator
|
5
|
+
# Instantiate a new instance of Translator for a chosen language
|
6
|
+
#
|
7
|
+
# ==== Examples
|
8
|
+
#
|
9
|
+
# Freakin::Translator.new('spanish')
|
10
|
+
#
|
11
|
+
def initialize(language)
|
12
|
+
@language = language
|
13
|
+
end
|
14
|
+
|
15
|
+
# Call to return a greeting
|
16
|
+
# ==== Examples
|
17
|
+
#
|
18
|
+
# foo = Freakin::Translator.new('spanish')
|
19
|
+
# foo.hi # 'hola mundo'
|
20
|
+
#
|
21
|
+
def hi
|
22
|
+
case @language
|
23
|
+
when 'spanish'
|
24
|
+
'hola mundo'
|
25
|
+
else
|
26
|
+
'hello world'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/freakin.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'freakin/version'
|
2
|
+
require 'freakin/translator'
|
3
|
+
|
4
|
+
module Freakin #:nodoc:
|
5
|
+
# The main Freakin class. It is not intended to be instantiated and instead
|
6
|
+
# just need to call its hi method.
|
7
|
+
class Freakin
|
8
|
+
# When called returns a greeting matching the language defined. Currently
|
9
|
+
# supports English and Spanish.
|
10
|
+
#
|
11
|
+
# ==== Attributes
|
12
|
+
#
|
13
|
+
# * +language+ - Set to select a different language. Default is +english+.
|
14
|
+
#
|
15
|
+
# ==== Examples
|
16
|
+
#
|
17
|
+
# Freakin::Freakin.hi
|
18
|
+
# Freakin::Freakin.hi('spanish')
|
19
|
+
#
|
20
|
+
def self.hi(language = 'english')
|
21
|
+
trans = Translator.new(language)
|
22
|
+
trans.hi
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: freakin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alan Cruikshanks
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-05 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.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
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: rdoc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.2'
|
69
|
+
description: A freakin awesome gem that does nothing, awesomely!
|
70
|
+
email:
|
71
|
+
- alan.cruikshanks@gmail.com
|
72
|
+
executables:
|
73
|
+
- freakin
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
80
|
+
- ".travis.yml"
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE.txt
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bin/console
|
86
|
+
- bin/setup
|
87
|
+
- exe/freakin
|
88
|
+
- freakin.gemspec
|
89
|
+
- lib/freakin.rb
|
90
|
+
- lib/freakin/translator.rb
|
91
|
+
- lib/freakin/version.rb
|
92
|
+
homepage: https://github.com/cruikshanks/freakin
|
93
|
+
licenses:
|
94
|
+
- MIT
|
95
|
+
metadata:
|
96
|
+
allowed_push_host: https://rubygems.org/
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.5.1
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: A freakin awesome gem
|
117
|
+
test_files: []
|