proprocks 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +4 -0
  4. data/lib/proprocks.rb +25 -0
  5. metadata +48 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a26e4a3ed0f3d8e4732e837b51abbcc0a2fb618
4
+ data.tar.gz: b1428b6eafef85d8e9d6df69337e87f4a31d5acb
5
+ SHA512:
6
+ metadata.gz: 4bbe2585ae7248277ab027c31c053385d89b91f3d4240737ee15302d115d40cf39ac94e1633a16d0410af018e44bbeb059a729638a74a2485d03aa3c4a97f74b
7
+ data.tar.gz: 7984ac45185ef1d5a9e22aac90a3ae6e6b52230c2a3038bf8061b959860665b1acb8fa6467645ff0ffabf592e01e73584f0683e7f6e50aeaaa21852a4dc73baa
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Troy Howard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ proprocks
2
+ =========
3
+
4
+ Proprocks adds some sugar to Ruby class initialization.
data/lib/proprocks.rb ADDED
@@ -0,0 +1,25 @@
1
+ module PropRocks
2
+ def self.included(base)
3
+ base.extend(ClassMethods)
4
+ end
5
+
6
+ module ClassMethods
7
+ def prop(name, default=nil)
8
+ attr_accessor name
9
+
10
+ define_method name do |*values|
11
+ value = values.first
12
+ value ? self.send("#{name}=", value) : (instance_variable_get("@#{name}") || default)
13
+ end
14
+ end
15
+ end
16
+
17
+ def initialize(attrs = {}, &block)
18
+ if attrs
19
+ attrs.each do |k,v|
20
+ self.send "#{k}=", v
21
+ end
22
+ end
23
+ self.instance_eval(&block) if block_given?
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: proprocks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Troy Howard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Proprocks adds some sugar to Ruby class initialization
14
+ email: thoward37@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files:
18
+ - README.md
19
+ - LICENSE
20
+ files:
21
+ - lib/proprocks.rb
22
+ - README.md
23
+ - LICENSE
24
+ homepage: http://github.com/thoward/proprocks
25
+ licenses:
26
+ - MIT
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.3.6
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.1.10
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Proprocks adds some sugar to Ruby class initialization
48
+ test_files: []