ubyray 0.0.3

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.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+ --format documentation
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --no-private --protected lib/**/*.rb - README.md
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ubyray.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,7 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ watch('.rspec') { "spec" }
6
+ end
7
+
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Brian Kelly
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
+ [![Build Status](https://secure.travis-ci.org/spilth/ubyray.png?branch=master)](http://travis-ci.org/spilth/ubyray)
2
+
3
+ # [Ubyray](http://spilth.org/ubyray/)
4
+
5
+ This is a project for practicing Ruby programming, using RSpec, Travis CI and related tools.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'ubyray'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ubyray
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => :spec
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new
10
+
data/lib/ubyray.rb ADDED
@@ -0,0 +1,27 @@
1
+ require "ubyray/version"
2
+
3
+ module Ubyray
4
+ def self.translate(word)
5
+ if RUBY_VERSION < "1.9"
6
+ letter = word[0].chr.downcase
7
+ else
8
+ letter = word[0].downcase
9
+ end
10
+
11
+ rest = word[1..-1]
12
+ rest.capitalize! if self.capitalized?(word)
13
+ return "#{rest}#{letter}ay"
14
+ end
15
+
16
+ def self.capitalized?(word)
17
+ if RUBY_VERSION < "1.9"
18
+ ord = word[0]
19
+ else
20
+ ord = word[0].ord
21
+ end
22
+
23
+ ord < 97
24
+ end
25
+
26
+ end
27
+
@@ -0,0 +1,3 @@
1
+ module Ubyray
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Ubyray do
4
+ it "should translate words starting with lower case consanants" do
5
+ Ubyray.translate("ruby").should eq "ubyray"
6
+ end
7
+
8
+ it "should translate words starting with upper case consanants" do
9
+ Ubyray.translate("Ruby").should eq "Ubyray"
10
+ end
11
+
12
+ it "should detect if word start with a capital" do
13
+ Ubyray.capitalized?("Foo").should eq true
14
+ end
15
+
16
+ it "should detect if word doesn't start with a capital" do
17
+ Ubyray.capitalized?("bar").should eq false
18
+ end
19
+ end
20
+
@@ -0,0 +1,5 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
4
+ require File.expand_path("../../lib/ubyray", __FILE__)
5
+
data/ubyray.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/ubyray/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Brian Kelly"]
6
+ gem.email = ["polymonic@gmail.com"]
7
+ gem.description = %q{This is a project for practicing Ruby programming, using RSpec, Travis CI and related tools.}
8
+ gem.summary = %q{Pig Latin translator for Ruby}
9
+ gem.homepage = "http://spilth.org/ubyray/"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "ubyray"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Ubyray::VERSION
17
+
18
+ gem.add_development_dependency "rspec"
19
+ gem.add_development_dependency "rake"
20
+ gem.add_development_dependency "guard-rspec"
21
+ gem.add_development_dependency "simplecov"
22
+ gem.add_development_dependency "yard"
23
+ gem.add_development_dependency "redcarpet"
24
+ end
25
+
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ubyray
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian Kelly
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-16 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &2153772820 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *2153772820
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &2153771900 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *2153771900
36
+ - !ruby/object:Gem::Dependency
37
+ name: guard-rspec
38
+ requirement: &2153771200 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2153771200
47
+ - !ruby/object:Gem::Dependency
48
+ name: simplecov
49
+ requirement: &2153770480 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *2153770480
58
+ - !ruby/object:Gem::Dependency
59
+ name: yard
60
+ requirement: &2153770000 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *2153770000
69
+ - !ruby/object:Gem::Dependency
70
+ name: redcarpet
71
+ requirement: &2153769540 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *2153769540
80
+ description: This is a project for practicing Ruby programming, using RSpec, Travis
81
+ CI and related tools.
82
+ email:
83
+ - polymonic@gmail.com
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - .gitignore
89
+ - .rspec
90
+ - .travis.yml
91
+ - .yardopts
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - Guardfile
95
+ - LICENSE
96
+ - README.md
97
+ - Rakefile
98
+ - lib/ubyray.rb
99
+ - lib/ubyray/version.rb
100
+ - spec/lib/ubyray_spec.rb
101
+ - spec/spec_helper.rb
102
+ - ubyray.gemspec
103
+ homepage: http://spilth.org/ubyray/
104
+ licenses: []
105
+ post_install_message:
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ! '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 1.8.11
124
+ signing_key:
125
+ specification_version: 3
126
+ summary: Pig Latin translator for Ruby
127
+ test_files:
128
+ - spec/lib/ubyray_spec.rb
129
+ - spec/spec_helper.rb
130
+ has_rdoc: