yamlable 0.0.1

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: 1db249b0c93db7999cd5ef04a454597e374db828
4
+ data.tar.gz: c7f75f20523229b0d8b5f1c3dafc46acfc05ba64
5
+ SHA512:
6
+ metadata.gz: a9f0be44a3b27e79575a7cda63d57c300f6213428b23ef831e699f880f2db5fdef69c7eab420272eafe91b7d98233430c6c8b4580e068dba66bb55fb2bf5d1a9
7
+ data.tar.gz: 04ae73890fb46b2ddc44b38dd8ecf0487ef9f68eb7e1c42e40b40de921db3c224a6c6aa957bebb96d0b5575f47cf8bdbcbd3604bf5e765b1ab8c932389b6174b
data/.gitignore ADDED
@@ -0,0 +1,39 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalization:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ # .ruby-version
33
+ # .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
37
+
38
+ # RubyMine
39
+ /.idea/
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.1.5"
4
+ - "2.2.0"
5
+ - "2.3.0"
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in yamlable.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'minitest'
8
+ gem 'minitest-reporters'
9
+ gem 'reek'
10
+ gem 'rubocop'
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ yamlable (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ansi (1.5.0)
10
+ ast (2.2.0)
11
+ axiom-types (0.1.1)
12
+ descendants_tracker (~> 0.0.4)
13
+ ice_nine (~> 0.11.0)
14
+ thread_safe (~> 0.3, >= 0.3.1)
15
+ builder (3.2.2)
16
+ codeclimate-engine-rb (0.3.1)
17
+ virtus (~> 1.0)
18
+ coercible (1.0.0)
19
+ descendants_tracker (~> 0.0.1)
20
+ descendants_tracker (0.0.4)
21
+ thread_safe (~> 0.3, >= 0.3.1)
22
+ equalizer (0.0.11)
23
+ ice_nine (0.11.2)
24
+ minitest (5.8.4)
25
+ minitest-reporters (1.1.8)
26
+ ansi
27
+ builder
28
+ minitest (>= 5.0)
29
+ ruby-progressbar
30
+ parser (2.3.0.7)
31
+ ast (~> 2.2)
32
+ powerpack (0.1.1)
33
+ rainbow (2.1.0)
34
+ rake (10.3.2)
35
+ reek (4.0.1)
36
+ codeclimate-engine-rb (~> 0.3.1)
37
+ parser (~> 2.3, >= 2.3.0.6)
38
+ rainbow (~> 2.0)
39
+ rubocop (0.39.0)
40
+ parser (>= 2.3.0.7, < 3.0)
41
+ powerpack (~> 0.1)
42
+ rainbow (>= 1.99.1, < 3.0)
43
+ ruby-progressbar (~> 1.7)
44
+ unicode-display_width (~> 1.0, >= 1.0.1)
45
+ ruby-progressbar (1.7.5)
46
+ thread_safe (0.3.5)
47
+ unicode-display_width (1.0.3)
48
+ virtus (1.0.5)
49
+ axiom-types (~> 0.1)
50
+ coercible (~> 1.0)
51
+ descendants_tracker (~> 0.0, >= 0.0.3)
52
+ equalizer (~> 0.0, >= 0.0.9)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ bundler (~> 1.10)
59
+ minitest
60
+ minitest-reporters
61
+ rake (~> 10.0)
62
+ reek
63
+ rubocop
64
+ yamlable!
65
+
66
+ BUNDLED WITH
67
+ 1.10.5
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Chris Baker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Yamlable
2
+
3
+ [![Build Status](https://travis-ci.org/folkengine/yamlable.svg?branch=master)](https://travis-ci.org/folkengine/yamlable)
4
+
5
+ Simple Ruby Module that adds to_yaml to any Object that includes it.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'yamlable'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install yamlable
22
+
23
+ ## Usage
24
+
25
+
26
+ ```ruby
27
+ class Example
28
+ include Yamlable
29
+ ...
30
+ ```
31
+
32
+ ```ruby
33
+ ex = Example.new
34
+ ex_yaml = ex.to_yaml
35
+ ex_again = Yamlable.from_yaml(ex_yaml)
36
+ ```
37
+
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/folkengine/yamlable.
48
+
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+ require 'reek/rake/task'
4
+ require 'rubocop/rake_task'
5
+
6
+ task default: :test
7
+
8
+ Reek::Rake::Task.new do |t|
9
+ t.fail_on_error = false
10
+ end
11
+
12
+ RuboCop::RakeTask.new
13
+
14
+ Rake::TestTask.new do |t|
15
+ t.libs << 'test'
16
+ t.test_files = FileList['test/**/test*.rb']
17
+ t.verbose = true
18
+ end
19
+
20
+ task :boom do
21
+ Rake::Task['test'].execute
22
+ puts 'Running Reek...'
23
+ Rake::Task['reek'].execute
24
+ puts
25
+ Rake::Task['rubocop'].execute
26
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'yamlable'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require 'pry'
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module Yamlable
2
+ VERSION = '0.0.1'.freeze
3
+ end
data/lib/yamlable.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'psych'
2
+ require 'yamlable/version'
3
+
4
+ # Adds to_yaml method to your Objects:
5
+ #
6
+ # class Example
7
+ # include Yamlable
8
+ # ...
9
+ #
10
+ module Yamlable
11
+ def to_yaml
12
+ Psych.dump(self)
13
+ end
14
+
15
+ def self.from_yaml(yaml)
16
+ Psych.load(yaml)
17
+ end
18
+ end
data/yamlable.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'yamlable/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'yamlable'
8
+ spec.version = Yamlable::VERSION
9
+ spec.authors = ['folkengine']
10
+ spec.email = ['gaoler@electronicpanopticon.com']
11
+
12
+ spec.summary = 'To and from yaml methods.'
13
+ spec.description = 'Making it easier to go to and from yaml in Objects.'
14
+ spec.homepage = 'https://github.com/folkengine/yamlable'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ }
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.required_ruby_version = '>= 2.1.5'
24
+ spec.add_development_dependency 'bundler', '~> 1.10'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yamlable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - folkengine
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-04-24 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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
+ description: Making it easier to go to and from yaml in Objects.
42
+ email:
43
+ - gaoler@electronicpanopticon.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".travis.yml"
50
+ - Gemfile
51
+ - Gemfile.lock
52
+ - LICENSE
53
+ - README.md
54
+ - Rakefile
55
+ - bin/console
56
+ - bin/setup
57
+ - lib/yamlable.rb
58
+ - lib/yamlable/version.rb
59
+ - yamlable.gemspec
60
+ homepage: https://github.com/folkengine/yamlable
61
+ licenses: []
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.1.5
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.5.1
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: To and from yaml methods.
83
+ test_files: []