rb_toolbox 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4565b4e9f5ce526ecc8d31c9eb7a426967062b4
4
+ data.tar.gz: 6e395a1f91323a4f3e826c8ef6c08cc1ed62535f
5
+ SHA512:
6
+ metadata.gz: b07efdedb3c9716a066d366de8a2008c0bb04514b3459986faef16e5982457c064a98e92b29c44d49c57a8369a8befc176b7c5c3530e8b0f14092c21cdfcd46c
7
+ data.tar.gz: 7a4bbf8f4744804417771821c77ecdb3f076d1519d26d0736aaa441af154aed8b26032ef556f525b924b81f63666fb523cfbfd50cafb6a2b9033e00152c086d7
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ /README.html
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/CHANGELOG.org ADDED
@@ -0,0 +1,3 @@
1
+ * v0.0.1
2
+
3
+ ** Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+ gemspec
3
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Federico Iachetti
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.
data/README.org ADDED
@@ -0,0 +1,51 @@
1
+ * RbToolbox
2
+
3
+ This gem contains some features I use all the time and aren't part of the standard library.
4
+
5
+ ** Usage
6
+
7
+ *** Structs
8
+ I like my structs to be initialized using named instead of positional arguments.
9
+
10
+ =RbToolbox::Struct= uses named arguments.
11
+
12
+ It has all the features you may expect from a =::Struct=
13
+
14
+ To create a Struct:
15
+ #+BEGIN_SRC ruby
16
+ require "rb_toolbox/struct"
17
+ Point = RbToolbox::Struct.new(:x, :y)
18
+
19
+ p = Point.new(y: 5, x: 4)
20
+
21
+ p.x # => 4
22
+ p.y # => 5
23
+ #+END_SRC
24
+
25
+ #+results:
26
+
27
+ *** TODO String helpers (TODO)
28
+
29
+ ** Installation
30
+
31
+ Add this line to your application's Gemfile:
32
+
33
+ gem 'rb-toolbox'
34
+
35
+ And then execute:
36
+
37
+ $ bundle
38
+
39
+ Or install it yourself as:
40
+
41
+ $ gem install rb-toolbox
42
+
43
+
44
+
45
+ ** Contributing
46
+
47
+ 1. Fork it ( https://github.com/[my-github-username]/rb-toolbox/fork )
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,9 @@
1
+ module RbToolbox
2
+ class Struct < ::Struct
3
+ def initialize(args={})
4
+ args.each do |k,v|
5
+ self.send("#{k}=", v)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module RbToolbox
2
+ VERSION = "0.0.2"
3
+ end
data/lib/rb_toolbox.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "rb_toolbox/version"
2
+ require "rb_toolbox/struct"
3
+
4
+ module RbToolbox
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rb_toolbox/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rb_toolbox"
8
+ spec.version = RbToolbox::VERSION
9
+ spec.authors = ["Federico Iachetti"]
10
+ spec.email = ["iachetti.federico@gmail.com"]
11
+ spec.summary = %q{Ruby Tools}
12
+ spec.description = %q{Some Ruby toold I need all the time}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", "~> 2.12"
24
+ spec.add_development_dependency "rspec-given", "~> 3.5.4"
25
+ end
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+ require "rb_toolbox/struct"
3
+
4
+ Point = RbToolbox::Struct.new(:x, :y)
5
+
6
+ module RbToolbox
7
+ describe Struct do
8
+ context "Initialization" do
9
+ Given(:p) { Point.new(x: 5, y: 6) }
10
+ Then { p.x == 5 }
11
+ Then { p.y == 6 }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ require "rspec/given"
2
+ RSpec.configure do |config|
3
+ config.treat_symbols_as_metadata_keys_with_true_values = true
4
+ config.run_all_when_everything_filtered = true
5
+ config.filter_run :focus
6
+ config.order = 'random'
7
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rb_toolbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Federico Iachetti
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-27 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-given
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.5.4
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.5.4
69
+ description: Some Ruby toold I need all the time
70
+ email:
71
+ - iachetti.federico@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - CHANGELOG.org
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.org
82
+ - Rakefile
83
+ - lib/rb_toolbox.rb
84
+ - lib/rb_toolbox/struct.rb
85
+ - lib/rb_toolbox/version.rb
86
+ - rb_toolbox.gemspec
87
+ - spec/rb_toolbox/struct_spec.rb
88
+ - spec/spec_helper.rb
89
+ homepage: ''
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: '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.2.2
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Ruby Tools
113
+ test_files:
114
+ - spec/rb_toolbox/struct_spec.rb
115
+ - spec/spec_helper.rb