pancake-parser 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .gitingnore~
6
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in PancakeParser.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Alex Maslakov
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.
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/PancakeParser/version', __FILE__)
3
+
4
+
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.authors = ["Alex Maslakov"]
8
+ gem.email = ["gilded.honour@gmail.com"]
9
+ gem.description = %q{PancakeParser allows you to search pancakes pretty easy.}
10
+ gem.summary = %q{Wherever pancakes are, you will find all of them.}
11
+ gem.homepage = "https://rubygems.org/gems/pancake-parser"
12
+
13
+ gem.files = `git ls-files`.split($\)
14
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.name = "pancake-parser"
17
+ gem.require_paths = ["lib"]
18
+ gem.version = PancakeParser::VERSION
19
+ gem.add_development_dependency 'rspec'
20
+
21
+ end
@@ -0,0 +1,30 @@
1
+ # PancakeParser
2
+
3
+ PancakeParser allows you to search pancakes pretty easy.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'PancakeParser'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install PancakeParser
18
+
19
+ ## Usage
20
+
21
+ The heart of pancakeparser is the method called "how_many?". Call how_many?(initial_string) to know how many words "pancake" the argument "initial_string" has.
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
30
+
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,9 @@
1
+ require "PancakeParser/version"
2
+
3
+ module PancakeParser
4
+
5
+ def self.how_many?(pancakeable_string)
6
+ pancakeable_string.scan(/pancake/i).count
7
+ end
8
+
9
+ end
@@ -0,0 +1,3 @@
1
+ module PancakeParser
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,17 @@
1
+ require_relative '../lib/PancakeParser.rb'
2
+
3
+ describe PancakeParser do
4
+
5
+ it "should return 3 pancakes" do
6
+ PancakeParser::how_many?("pancake1343 PpancakeP PANCAke gfdgf354354").should == 3
7
+ end
8
+
9
+ it "should return 0 pancakes" do
10
+ PancakeParser::how_many?("some values that do not have any ppppp").should == 0
11
+ end
12
+
13
+ it "should return 0 pancakes if string is empty" do
14
+ PancakeParser::how_many?("").should == 0
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pancake-parser
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alex Maslakov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !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: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: PancakeParser allows you to search pancakes pretty easy.
31
+ email:
32
+ - gilded.honour@gmail.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - Gemfile.lock
40
+ - LICENSE
41
+ - PancakeParser.gemspec
42
+ - README.md
43
+ - Rakefile
44
+ - lib/PancakeParser.rb
45
+ - lib/PancakeParser/version.rb
46
+ - spec/pancake_parser_spec.rb
47
+ homepage: https://rubygems.org/gems/pancake-parser
48
+ licenses: []
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project:
67
+ rubygems_version: 1.8.24
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: Wherever pancakes are, you will find all of them.
71
+ test_files:
72
+ - spec/pancake_parser_spec.rb
73
+ has_rdoc: