adams_song 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5e4beafd375b2aa22e9f06612ddd8189f6b13e84
4
+ data.tar.gz: a292e48871d3613e1b5d3bffb0e9c17053632090
5
+ SHA512:
6
+ metadata.gz: dd2d2163b6bf8a888dd5017e1f5a61f6b683e6a66b8ac9fb937cea09cd63cf25d024715d8d970d8499a4e57e8efd6aa99484444d1a0c7f3e4b4603fa1a266be9
7
+ data.tar.gz: 6c2a586d2a40b5ad284d73ec3e61e13312e61b9434efde23468daeadf402bc0759559bc74b0bd6c898c9eafc586ace7aa095799d8fce5475f09319fc5b38256d
Binary file
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+
7
+ script: 'bundle exec rake'
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in adams-song.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Cole Willsea
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,9 @@
1
+ # Adams::Song
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/adams_song.svg)](http://badge.fury.io/rb/adams_song) [![Build Status](https://travis-ci.org/coleww/adams_song.svg?branch=master)](https://travis-ci.org/coleww/adams_song)
4
+
5
+ patches the String class to respond to #adams_song?
6
+
7
+ gem install 'adams_song'
8
+
9
+ etc.
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require "rake/testtask"
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.test_files = FileList['test/*_test.rb']
7
+ end
8
+
9
+ task default: :test
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'adams_song/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "adams_song"
8
+ spec.version = AdamsSong::VERSION
9
+ spec.authors = ["Cole Willsea"]
10
+ spec.email = ["coleww@gmail.com"]
11
+ spec.summary = %q{Patches String class to know whether or not it is a lyric from Adams Song by Blink 182}
12
+ spec.homepage = "https://github.com/coleww/adams_song"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.test_files = spec.files.grep(%r{^(test)/})
17
+ spec.require_paths = ["lib"]
18
+ spec.required_ruby_version = '>= 2.0.0'
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency 'test_construct'
23
+ spec.add_development_dependency 'minitest'
24
+ end
Binary file
@@ -0,0 +1,19 @@
1
+ require "adams_song/version"
2
+
3
+ class String
4
+
5
+ def adams_song?
6
+ that = self.downcase.gsub(/[^a-zA-Z\d\s]/, '')
7
+ !!(that.match /i?\s?(cant|couldnt)\s+wait\s+(till|until)\s+i\s+(got|get)\s+home\s+to\s+pass\s+the\s+time\s+in\s+my\s+room\s+alone/) ||
8
+ !!(that.match /i?\s?never\s+thought\s+id\s+die\s+alone\s+(i laughed the loudest|another six months)\s+(whod have known|ill be unknown)/) ||
9
+ !!(that.match /i?\s?never\s+conquered\s+rarely\s+came\s+(tomorrow|16 just)\s+(held|holds)\s+such\s+better\s+days/) ||
10
+ !!(that.match /days\s+when\s+i\s+(can still|still)\s+(feel|felt)\s+alive\s+(when i|we)\s+(couldnt|cant)\s+wait\s+to\s+get\s+outside/) ||
11
+ !!(that.match /i\s+traced\s+the\s+cord\s+back\s+to\s+the\s+wall\s+no\s+wonder\s+it\s+was\s+never\s+plugged\s+in\s+at\s+all/) ||
12
+ !!(that.match /i took my time i hurried up the choice was mine i didnt think enough/) || # i am bored now. this is boring.
13
+ !!(that.match /im too depressed to go on youll be sorry when im gone/) ||
14
+ !!(that.match /give all my things to all my friends youll never step foot in my room again/) ||
15
+ !!(that.match /remember the time that i spilled the cup of apple juice in the hall please tell mom this is not her fault/)
16
+
17
+ end
18
+
19
+ end
Binary file
@@ -0,0 +1,3 @@
1
+ module AdamsSong
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,94 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/pride'
3
+ require_relative '../lib/adams_song.rb'
4
+
5
+ class TestStringAdamsSong < Minitest::Test
6
+
7
+ def test_knows_cant_wait
8
+ assert_equal true, "I can't wait till I get home to pass the time in my room alone".adams_song?
9
+ end
10
+
11
+ def test_knows_a_fuzzy_cant
12
+ assert_equal true, "I cant wait till I get home to pass the time in my room alone".adams_song?
13
+ end
14
+
15
+ def test_accepts_couldnt
16
+ assert_equal true, "I couldnt wait till I get home to pass the time in my room alone".adams_song?
17
+ end
18
+
19
+ def test_knows_about_until
20
+ assert_equal true, "I cant wait until I get home to pass the time in my room alone".adams_song?
21
+ end
22
+
23
+ def test_knows_about_got
24
+ assert_equal true, "I can't wait till I got home to pass the time in my room alone".adams_song?
25
+ end
26
+
27
+ def test_knows_omissions_are_cool_sometimes
28
+ assert_equal true, "can't wait till I get home to pass the time in my room alone".adams_song?
29
+ end
30
+
31
+ def test_dgafs_about_punctuations
32
+ assert_equal true, "I can't wait, till I get home/ to pass the time: in my room alone".adams_song?
33
+ end
34
+
35
+ def test_knows_what_is_not_it
36
+ assert_equal false, "I dont want to go to school".adams_song?
37
+ end
38
+
39
+ def test_accepts_things_with_hashtags
40
+ assert_equal true, "#watlol I can't wait till I get home to pass the time in my room alone".adams_song?
41
+ end
42
+
43
+ def test_accepts_things_with_urls
44
+ assert_equal true, "I can't wait till I get home to pass the time in my room alone http://google.com".adams_song?
45
+ end
46
+
47
+ def test_accepts_things_with_twitterish_urls
48
+ assert_equal true, "I can't wait till I get home to pass the time in my room alone tmblr.co/g00gL3".adams_song?
49
+ end
50
+
51
+ def test_knows_laughed_loudest
52
+ assert_equal true, "i never thought id die alone i laughed the loudest whod have known".adams_song?
53
+ end
54
+
55
+ def test_knows_be_unknown
56
+ assert_equal true, "i never thought id die alone another six months ill be unknown".adams_song?
57
+ end
58
+
59
+ def test_knows_tomorrow
60
+ assert_equal true, "i never conquered rarely came tomorrow holds such better days".adams_song?
61
+ end
62
+
63
+ def test_knows_sixteen
64
+ assert_equal true, "i never conquered rarely came 16 just held such better days".adams_song?
65
+ end
66
+
67
+ def test_knows_we_couldnt
68
+ assert_equal true, "Days when i still felt alive we couldnt wait to get outside".adams_song?
69
+ end
70
+
71
+ def test_knows_i_couldnt
72
+ assert_equal true, "Days when i can still feel alive when i cant wait to get outside".adams_song?
73
+ end
74
+
75
+ def test_knows_traced_cord
76
+ assert_equal true, "i traced the cord back to the wall no wonder it was never plugged in at all".adams_song?
77
+ end
78
+
79
+ def test_knows_took_time
80
+ assert_equal true, "i took my time i hurried up the choice was mine i didnt think enough".adams_song?
81
+ end
82
+
83
+ def test_knows_too_depressed
84
+ assert_equal true, "im too depressed to go on youll be sorry when im gone".adams_song?
85
+ end
86
+
87
+ def test_knows_all_my_thing
88
+ assert_equal true, "Give all my things to all my friends youll never step foot in my room again".adams_song?
89
+ end
90
+
91
+ def test_knows_apple_juice
92
+ assert_equal true, "Remember the time that i spilled the cup Of apple juice in the hall Please tell mom this is not her fault".adams_song?
93
+ end
94
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adams_song
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Cole Willsea
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-01 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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
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: test_construct
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
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
+ description:
70
+ email:
71
+ - coleww@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .DS_Store
77
+ - .gitignore
78
+ - .travis.yml
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - adams-song.gemspec
84
+ - lib/.DS_Store
85
+ - lib/adams_song.rb
86
+ - lib/adams_song/.DS_Store
87
+ - lib/adams_song/version.rb
88
+ - test/adams_song_test.rb
89
+ homepage: https://github.com/coleww/adams_song
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 2.0.0
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.0.14
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Patches String class to know whether or not it is a lyric from Adams Song
113
+ by Blink 182
114
+ test_files:
115
+ - test/adams_song_test.rb