in_array 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +4 -0
  3. data/README.md +26 -0
  4. data/in_array.gemspec +34 -0
  5. data/rakefile.rb +14 -1
  6. metadata +45 -14
  7. data/README +0 -8
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTkxMGJhMjQ3MWRjMGVlZWQ4ZTA0ZGUyZjZkMzI5NzBmMDljYTdiMQ==
4
+ ZjAzNTlhMDA4YjY2Y2UxNWM1NTAxMjUyMmY1MjE2ODQ2ZTFiMmRiMw==
5
5
  data.tar.gz: !binary |-
6
- Yjc1NmM3MGQyYTc2ZDJjYzBhMGU4N2JjNTBjMThhNmUxZGNiZDI3MQ==
6
+ OGNiZTYyZTE3Njg0YWZjNWY1M2UxYzA0YjIyNDNmZWYzNjViODA2Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzcwMTVlNGQ2ZmU4M2Q0NGQ3NDA0NGJiNmNhMzUxM2IyOWQxNGE4NDE1OTk2
10
- YWM5OTk2N2U1MmEyZGU1OWJjMzA5NGEwYWFmOGU1N2VhYzQ4OWYzN2YwMzRl
11
- MzBiNWY5NzEzZjcwYjM5NDVhMmJmOTMzNmFhMjY3OGVmN2M3YWQ=
9
+ ZGY5NmUyYjBlNzY3ZjM5MTcwZWI2OTg4NDcxYzJjMDlkZTVmMWZhMDY1ODlh
10
+ N2Y3NjZlYWI1YjA0ZjNiNjFhMmYzYjMyMzE4NGE5YzA4YTlkZDdmNWM2MGU2
11
+ NTY1ZjcwNmVmMzlhOWEzMDg5YjEwZmI4ODQ3MDdkZTY4ZmMzYzg=
12
12
  data.tar.gz: !binary |-
13
- NjkyMmE1MDc2ZDEzNTk1NWM1NzAzYTdmZmVhMDliNWJmZmFkMWFlOWVmY2Zl
14
- NGE5ZjMwOTM5MTE4NzUxNmY3OGYxNDEyNjEwYjQyMzkzY2JiMmIxZTIwNzNm
15
- MDgwNWM5OWQwMGE0OWUwMTMzNDJlNzEzZmQ2YzBjY2I2NTczMjc=
13
+ Y2ZiNGU3MTc0NzQ3ZDI0ZDNjZDhiNWY5MDQ3NzQzMjQ2ZThiZmI1YWE5NTFm
14
+ MzE2Njg5MTAzM2U4YmNhNzIxZmI0Y2Q0YjgyYTllZjE3ZTk2ZWRjYTg1N2U4
15
+ ZDA2NTAyMTkyMjg1OWU3YTUzNWVkYzliNGU5ZmM2ZGIyYWNkNTg=
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ rdoc/
2
+ *.gem
3
+ *.zip
4
+ *.tmp
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # The in_array gem.
2
+
3
+ This project contains the Ruby in_array gem. This is perhaps the tiniest gem
4
+ ever created. It allows all objects to respond to the :in_array method that
5
+ encapsulates the object in an array unless it is already an array. So
6
+
7
+ 'Hello'.in_array ====> ['Hello']
8
+ ['Hello'].in_array ====> ['Hello']
9
+ my_object.in_array ====> [my_object]
10
+ [1,2,3].in_array ====> [1,2,3]
11
+
12
+ While not a terribly useful gem, it does demonstrate the use of inheritance
13
+ and true as opposed to simulated polymorphism.
14
+
15
+ ## Usage
16
+
17
+ require 'in_array'
18
+
19
+ then, in those places where array-ness was problematic, use:
20
+
21
+ my_object.in_array.each do |option| #etc, etc, etc...
22
+
23
+ instead of
24
+
25
+ my_object = [my_object] unless my_object.is_a?(Array)
26
+ my_object.each do |option| #etc, etc, etc...
data/in_array.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+
3
+ #Specify the building of the in_array gem.
4
+
5
+ lib = File.expand_path('../lib', __FILE__)
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+ require 'in_array/version'
8
+
9
+ Gem::Specification.new do |s|
10
+ s.name = "in_array"
11
+ s.summary = "Encapsulate data in an array."
12
+ s.description = "Encapsulate data in an array unless it's already in one. "
13
+ s.version = InArray::VERSION
14
+ s.author = ["Peter Camilleri"]
15
+ s.email = "peter.c.camilleri@gmail.com"
16
+ s.homepage = "http://teuthida-technologies.com/"
17
+ s.platform = Gem::Platform::RUBY
18
+ s.required_ruby_version = '>=1.9.3'
19
+
20
+ s.add_development_dependency "bundler", "~> 1.3"
21
+ s.add_development_dependency 'rake'
22
+ s.add_development_dependency 'reek', "~> 1.3.8"
23
+ s.add_development_dependency 'minitest', "~> 4.7.5"
24
+ s.add_development_dependency 'rdoc', "~> 4.0.1"
25
+
26
+ s.files = `git ls-files`.split($/)
27
+ s.extra_rdoc_files = ['license.txt']
28
+ s.test_files = ['tests/in_array_test.rb']
29
+
30
+ s.license = 'MIT'
31
+ s.has_rdoc = true
32
+ s.require_path = 'lib'
33
+ end
34
+
data/rakefile.rb CHANGED
@@ -1,10 +1,16 @@
1
1
  #!/usr/bin/env rake
2
+ # coding: utf-8
3
+
2
4
  require 'rake/testtask'
3
5
  require 'rdoc/task'
6
+ require "bundler/gem_tasks"
4
7
 
5
8
  RDoc::Task.new do |rdoc|
6
9
  rdoc.rdoc_dir = "rdoc"
7
- rdoc.rdoc_files = ['lib/in_array.rb', 'license.txt']
10
+
11
+ #List out all the files to be documented.
12
+ rdoc.rdoc_files.include("lib/**/*.rb", "license.txt", "readme.md")
13
+
8
14
  rdoc.options << '--visibility' << 'private'
9
15
  end
10
16
 
@@ -13,6 +19,13 @@ Rake::TestTask.new do |t|
13
19
  t.verbose = false
14
20
  end
15
21
 
22
+ desc "Run a scan for smelly code!"
16
23
  task :reek do |t|
17
24
  `reek lib\\*.rb > reek.txt`
18
25
  end
26
+
27
+ desc "What version of in_array is this?"
28
+ task :vers do |t|
29
+ puts
30
+ puts "in_array version = #{InArray::VERSION}"
31
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in_array
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2014-11-04 00:00:00.000000000 Z
12
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.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -28,30 +42,44 @@ dependencies:
28
42
  name: reek
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ! '>='
45
+ - - ~>
32
46
  - !ruby/object:Gem::Version
33
- version: '0'
47
+ version: 1.3.8
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ! '>='
52
+ - - ~>
39
53
  - !ruby/object:Gem::Version
40
- version: '0'
54
+ version: 1.3.8
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: minitest
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ! '>='
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
- version: '0'
61
+ version: 4.7.5
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ! '>='
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
- version: '0'
68
+ version: 4.7.5
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 4.0.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 4.0.1
55
83
  description: ! 'Encapsulate data in an array unless it''s already in one. '
56
84
  email: peter.c.camilleri@gmail.com
57
85
  executables: []
@@ -59,12 +87,14 @@ extensions: []
59
87
  extra_rdoc_files:
60
88
  - license.txt
61
89
  files:
90
+ - .gitignore
91
+ - README.md
92
+ - in_array.gemspec
62
93
  - lib/in_array.rb
63
- - tests/in_array_test.rb
64
- - rakefile.rb
65
94
  - license.txt
66
- - README
95
+ - rakefile.rb
67
96
  - reek.txt
97
+ - tests/in_array_test.rb
68
98
  homepage: http://teuthida-technologies.com/
69
99
  licenses:
70
100
  - MIT
@@ -88,6 +118,7 @@ rubyforge_project:
88
118
  rubygems_version: 2.1.4
89
119
  signing_key:
90
120
  specification_version: 4
91
- summary: Encapsulate data in an array unless it's already in one.
121
+ summary: Encapsulate data in an array.
92
122
  test_files:
93
123
  - tests/in_array_test.rb
124
+ has_rdoc: true
data/README DELETED
@@ -1,8 +0,0 @@
1
- This project contains the Ruby in_array gem. This is perhaps the tiniest gem
2
- ever created. It allows all objects to respond to the :in_array method that
3
- encapsulates the object in an array unless it is already an array. So
4
-
5
- 'Hello'.in_array ====> ['Hello']
6
- ['Hello'].in_array ====> ['Hello']
7
- my_object.in_array ====> [my_object]
8
- [1,2,3].in_array ====> [1,2,3]