array_attribute 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjUzNGU4NDVhMjdjYTkzNGMwNDU1ZjE1N2JiYTA1Yjk2ODAyNTNlOQ==
5
+ data.tar.gz: !binary |-
6
+ NTBhOGQ3OTlmOWYwZTYyYzA5NDZhMGNlYmI4Zjc1ODY1NWNjYzViMw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YjA5NDBiZmVlNzJhNjlhMzYwMDdjNDVmNTdhMTdmZjc0Y2MzMmYyNzY5ODBh
10
+ ZWY1YWZjZGUyZTAxNGJlMTBkMDA4OGJiNzBmYjY0OTJhNjRiNmI2MjE1NjNh
11
+ ZWUwZGVlYmJjOWRjMjY1YjRiNzA0NjE3N2NhYTc5ZWVlYWQ1ZmY=
12
+ data.tar.gz: !binary |-
13
+ ZTVjOWRlODY4NTVkMGYxNjkzYWE3NDg4OWExZTVlMTVjOGE4NzliMzI1MWZl
14
+ MTYyYTg2MDNlZGQwZTY3MzcwM2VkNDBiNTc4ZmQxODI2ODY1NGE5ZjVkMWIz
15
+ NDdiNDFkYjMxNGI4ZGRmNmMzNDYyZmQyNTcwZDkxYzk3NjMzM2E=
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
@@ -0,0 +1 @@
1
+ array_attribute
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p484
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ group :development do
4
+ gem "jeweler", "~> 2.0.1"
5
+ end
@@ -0,0 +1,54 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ faraday (0.9.0)
9
+ multipart-post (>= 1.2, < 3)
10
+ git (1.2.6)
11
+ github_api (0.11.3)
12
+ addressable (~> 2.3)
13
+ descendants_tracker (~> 0.0.1)
14
+ faraday (~> 0.8, < 0.10)
15
+ hashie (>= 1.2)
16
+ multi_json (>= 1.7.5, < 2.0)
17
+ nokogiri (~> 1.6.0)
18
+ oauth2
19
+ hashie (2.1.1)
20
+ highline (1.6.21)
21
+ jeweler (2.0.1)
22
+ builder
23
+ bundler (>= 1.0)
24
+ git (>= 1.2.5)
25
+ github_api
26
+ highline (>= 1.6.15)
27
+ nokogiri (>= 1.5.10)
28
+ rake
29
+ rdoc
30
+ json (1.8.1)
31
+ jwt (1.0.0)
32
+ mini_portile (0.6.0)
33
+ multi_json (1.10.1)
34
+ multi_xml (0.5.5)
35
+ multipart-post (2.0.0)
36
+ nokogiri (1.6.2.1)
37
+ mini_portile (= 0.6.0)
38
+ oauth2 (0.9.4)
39
+ faraday (>= 0.8, < 0.10)
40
+ jwt (~> 1.0)
41
+ multi_json (~> 1.3)
42
+ multi_xml (~> 0.5)
43
+ rack (~> 1.2)
44
+ rack (1.5.2)
45
+ rake (10.3.2)
46
+ rdoc (3.12.2)
47
+ json (~> 1.4)
48
+ thread_safe (0.3.4)
49
+
50
+ PLATFORMS
51
+ ruby
52
+
53
+ DEPENDENCIES
54
+ jeweler (~> 2.0.1)
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 kazuyoshi tlacaelel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = array_attribute
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to array_attribute
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2014 kazuyoshi tlacaelel. See LICENSE.txt for
18
+ further details.
19
+
@@ -0,0 +1,58 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "array_attribute"
18
+ gem.homepage = "http://github.com/ktlacaelel/array_attribute"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Array Attribute - Array atrribute accessor helper.}
21
+ gem.description = %Q{This helper creates two methods to classes.
22
+
23
+ array_attribute and carray_attribute.
24
+
25
+ With these you can create methods that encapsulate an array
26
+ property if you have never used or accessed the property it will
27
+ have an empty array as a default value.
28
+ }
29
+ gem.email = "kazu.dev@gmail.com"
30
+ gem.authors = ["kazuyoshi tlacaelel"]
31
+ # dependencies defined in Gemfile
32
+ end
33
+ Jeweler::RubygemsDotOrgTasks.new
34
+
35
+ require 'rake/testtask'
36
+ Rake::TestTask.new(:test) do |test|
37
+ test.libs << 'lib' << 'test'
38
+ test.pattern = 'test/**/test_*.rb'
39
+ test.verbose = true
40
+ end
41
+
42
+ desc "Code coverage detail"
43
+ task :simplecov do
44
+ ENV['COVERAGE'] = "true"
45
+ Rake::Task['test'].execute
46
+ end
47
+
48
+ task :default => :test
49
+
50
+ require 'rdoc/task'
51
+ Rake::RDocTask.new do |rdoc|
52
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
53
+
54
+ rdoc.rdoc_dir = 'rdoc'
55
+ rdoc.title = "array_attribute #{version}"
56
+ rdoc.rdoc_files.include('README*')
57
+ rdoc.rdoc_files.include('lib/**/*.rb')
58
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
@@ -0,0 +1,77 @@
1
+
2
+ # Array atrribute accessor helper.
3
+ #
4
+ # This helper creates two methods to classes.
5
+ #
6
+ # array_attribute and carray_attribute.
7
+ #
8
+ # With these you can create methods that encapsulate an array
9
+ # property if you have never used or accessed the property it will
10
+ # have an empty array as a default value.
11
+ #
12
+ # <code>
13
+ # class Developer
14
+ # carray_attribute :fingers
15
+ # array_attribute :tickets, :hot_chicks
16
+ # end
17
+ #
18
+ # developer = Developer.new
19
+ #
20
+ # puts developer.tickets.inspect
21
+ #
22
+ # developer.tickets << 1
23
+ # developer.tickets << 2
24
+ # developer.tickets << 3
25
+ # puts developer.tickets.inspect
26
+ #
27
+ # developer.tickets.pop
28
+ # developer.tickets.pop
29
+ # puts developer.tickets.inspect
30
+ #
31
+ # developer.tickets.pop
32
+ # puts developer.tickets.inspect
33
+ #
34
+ # puts developer.hot_chicks.inspect
35
+ #
36
+ # developer.hot_chicks << 1
37
+ # developer.hot_chicks << 2
38
+ # developer.hot_chicks << 3
39
+ # puts developer.hot_chicks.inspect
40
+ #
41
+ # puts Developer.fingers.inspect
42
+ #
43
+ # (1..10).to_a.each do |finger|
44
+ # Developer.fingers << finger
45
+ # end
46
+ #
47
+ # puts Developer.fingers.inspect
48
+ # <code>
49
+ #
50
+ class Module
51
+
52
+ # Instance level attribute accessor helper generator.
53
+ def array_attribute(*names)
54
+ names.each do |name|
55
+ self.send(:define_method, name) do
56
+ unless instance_variable_get("@#{name}")
57
+ instance_variable_set("@#{name}", [])
58
+ end
59
+ instance_variable_get("@#{name}")
60
+ end
61
+ end
62
+ end
63
+
64
+ # Class level attribute accessor helper generator.
65
+ def carray_attribute(*names)
66
+ names.each do |name|
67
+ self.class.send(:define_method, name) do
68
+ unless instance_variable_get("@#{name}")
69
+ instance_variable_set("@#{name}", [])
70
+ end
71
+ instance_variable_get("@#{name}")
72
+ end
73
+ end
74
+ end
75
+
76
+ end
77
+
@@ -0,0 +1,34 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ require 'rubygems'
18
+ require 'bundler'
19
+ begin
20
+ Bundler.setup(:default, :development)
21
+ rescue Bundler::BundlerError => e
22
+ $stderr.puts e.message
23
+ $stderr.puts "Run `bundle install` to install missing gems"
24
+ exit e.status_code
25
+ end
26
+ require 'test/unit'
27
+ require 'shoulda'
28
+
29
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
30
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
31
+ require 'array_attribute'
32
+
33
+ class Test::Unit::TestCase
34
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestArrayAttribute < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: array_attribute
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - kazuyoshi tlacaelel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jeweler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.1
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.1
27
+ description: ! "This helper creates two methods to classes.\n\narray_attribute and
28
+ carray_attribute.\n\nWith these you can create methods that encapsulate an array\nproperty
29
+ if you have never used or accessed the property it will\nhave an empty array as
30
+ a default value.\n "
31
+ email: kazu.dev@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files:
35
+ - LICENSE.txt
36
+ - README.rdoc
37
+ files:
38
+ - .document
39
+ - .ruby-gemset
40
+ - .ruby-version
41
+ - Gemfile
42
+ - Gemfile.lock
43
+ - LICENSE.txt
44
+ - README.rdoc
45
+ - Rakefile
46
+ - VERSION
47
+ - lib/array_attribute.rb
48
+ - test/helper.rb
49
+ - test/test_array_attribute.rb
50
+ homepage: http://github.com/ktlacaelel/array_attribute
51
+ licenses:
52
+ - MIT
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project:
70
+ rubygems_version: 2.2.2
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Array Attribute - Array atrribute accessor helper.
74
+ test_files: []