striuct 0.3.5 → 0.3.5.1
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.
- data/.travis.yml +9 -1
 - data/.yardopts +1 -1
 - data/Gemfile +0 -1
 - data/History.rdoc +5 -0
 - data/LICENSE +1 -1
 - data/README.md +7 -6
 - data/lib/striuct/singleton_class.rb +5 -4
 - data/lib/striuct/version.rb +1 -1
 - data/striuct.gemspec +4 -4
 - metadata +7 -7
 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/.yardopts
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --readme README.md -- 
     | 
| 
      
 1 
     | 
    
         
            +
            --readme README.md --private lib/**/*.rb --exclude inner|instancemethods/singleton_class - LICENSE
         
     | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/History.rdoc
    CHANGED
    
    
    
        data/LICENSE
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -93,22 +93,22 @@ foo.with_adjuster = '5' 
     | 
|
| 
       93 
93 
     | 
    
         
             
            foo.with_adjuster        #=> 5                # Casted via adjuster
         
     | 
| 
       94 
94 
     | 
    
         
             
            ```
         
     | 
| 
       95 
95 
     | 
    
         | 
| 
       96 
     | 
    
         
            -
            ### How to build  
     | 
| 
      
 96 
     | 
    
         
            +
            ### How to build flexible conditions ?
         
     | 
| 
       97 
97 
     | 
    
         | 
| 
       98 
98 
     | 
    
         
             
            * That from validation library.  
         
     | 
| 
       99 
     | 
    
         
            -
              See the [validation-API](http://kachick.github.com/ 
     | 
| 
      
 99 
     | 
    
         
            +
              See the [validation-API](http://kachick.github.com/validation/yard/frames.html)
         
     | 
| 
       100 
100 
     | 
    
         | 
| 
       101 
101 
     | 
    
         
             
            Requirements
         
     | 
| 
       102 
102 
     | 
    
         
             
            -------------
         
     | 
| 
       103 
103 
     | 
    
         | 
| 
       104 
     | 
    
         
            -
            * Ruby 1.9.2 or later 
     | 
| 
      
 104 
     | 
    
         
            +
            * Ruby - [1.9.2 or later](http://travis-ci.org/#!/kachick/striuct)
         
     | 
| 
       105 
105 
     | 
    
         
             
            * [validation](https://github.com/kachick/validation) - 0.0.3
         
     | 
| 
       106 
106 
     | 
    
         
             
            * [keyvalidatable](https://github.com/kachick/keyvalidatable) - 0.0.3
         
     | 
| 
       107 
107 
     | 
    
         | 
| 
       108 
108 
     | 
    
         
             
            Install
         
     | 
| 
       109 
109 
     | 
    
         
             
            -------
         
     | 
| 
       110 
110 
     | 
    
         | 
| 
       111 
     | 
    
         
            -
            ``` 
     | 
| 
      
 111 
     | 
    
         
            +
            ```bash
         
     | 
| 
       112 
112 
     | 
    
         
             
            $ gem install striuct
         
     | 
| 
       113 
113 
     | 
    
         
             
            ```
         
     | 
| 
       114 
114 
     | 
    
         | 
| 
         @@ -116,7 +116,8 @@ Link 
     | 
|
| 
       116 
116 
     | 
    
         
             
            ----
         
     | 
| 
       117 
117 
     | 
    
         | 
| 
       118 
118 
     | 
    
         
             
            * [code](https://github.com/kachick/striuct)
         
     | 
| 
       119 
     | 
    
         
            -
            * [ 
     | 
| 
      
 119 
     | 
    
         
            +
            * [wiki](https://github.com/kachick/striuct/wiki)
         
     | 
| 
      
 120 
     | 
    
         
            +
            * [API](http://kachick.github.com/striuct/yard/frames.html)
         
     | 
| 
       120 
121 
     | 
    
         
             
            * [issues](https://github.com/kachick/striuct/issues)
         
     | 
| 
       121 
122 
     | 
    
         
             
            * [CI](http://travis-ci.org/#!/kachick/striuct)
         
     | 
| 
       122 
123 
     | 
    
         
             
            * [gem](https://rubygems.org/gems/striuct)
         
     | 
| 
         @@ -125,6 +126,6 @@ License 
     | 
|
| 
       125 
126 
     | 
    
         
             
            --------
         
     | 
| 
       126 
127 
     | 
    
         | 
| 
       127 
128 
     | 
    
         
             
            The MIT X11 License  
         
     | 
| 
       128 
     | 
    
         
            -
            Copyright ( 
     | 
| 
      
 129 
     | 
    
         
            +
            Copyright (C) 2011 Kenichi Kamiya  
         
     | 
| 
       129 
130 
     | 
    
         
             
            See the file LICENSE for further details.
         
     | 
| 
       130 
131 
     | 
    
         | 
| 
         @@ -12,6 +12,7 @@ class Striuct 
     | 
|
| 
       12 
12 
     | 
    
         
             
                private :new_instance
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                # @param [Symbol, String] autonyms
         
     | 
| 
      
 15 
     | 
    
         
            +
                # @yieldreturn [Class]
         
     | 
| 
       15 
16 
     | 
    
         
             
                # @return [Class]
         
     | 
| 
       16 
17 
     | 
    
         
             
                def new(*autonyms, &block)
         
     | 
| 
       17 
18 
     | 
    
         
             
                  # warning for Ruby's Struct.new user
         
     | 
| 
         @@ -34,12 +35,12 @@ class Striuct 
     | 
|
| 
       34 
35 
     | 
    
         
             
                def define(&block)
         
     | 
| 
       35 
36 
     | 
    
         
             
                  raise ArgumentError, 'must with block' unless block_given?
         
     | 
| 
       36 
37 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
                  new(&block).tap  
     | 
| 
       38 
     | 
    
         
            -
                    subclass. 
     | 
| 
       39 
     | 
    
         
            -
                      raise 'not yet finished' if autonyms.empty?
         
     | 
| 
      
 38 
     | 
    
         
            +
                  new(&block).tap {|subclass|
         
     | 
| 
      
 39 
     | 
    
         
            +
                    subclass.class_eval do
         
     | 
| 
      
 40 
     | 
    
         
            +
                      raise 'not yet finished' if @autonyms.empty?
         
     | 
| 
       40 
41 
     | 
    
         
             
                      close
         
     | 
| 
       41 
42 
     | 
    
         
             
                    end
         
     | 
| 
       42 
     | 
    
         
            -
                   
     | 
| 
      
 43 
     | 
    
         
            +
                  }
         
     | 
| 
       43 
44 
     | 
    
         
             
                end
         
     | 
| 
       44 
45 
     | 
    
         | 
| 
       45 
46 
     | 
    
         
             
                # @groupend
         
     | 
    
        data/lib/striuct/version.rb
    CHANGED
    
    
    
        data/striuct.gemspec
    CHANGED
    
    | 
         @@ -1,12 +1,10 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # I don't know why dose occur errors below.
         
     | 
| 
       2 
     | 
    
         
            -
            #  require_relative 'lib/striuct/version'
         
     | 
| 
       3 
1 
     | 
    
         
             
            require File.expand_path('../lib/striuct/version', __FILE__)
         
     | 
| 
       4 
2 
     | 
    
         | 
| 
       5 
3 
     | 
    
         
             
            Gem::Specification.new do |gem|
         
     | 
| 
       6 
4 
     | 
    
         
             
              gem.authors       = ['Kenichi Kamiya']
         
     | 
| 
       7 
5 
     | 
    
         
             
              gem.email         = ['kachick1+ruby@gmail.com']
         
     | 
| 
       8 
6 
     | 
    
         
             
              gem.summary       = %q{Struct++}
         
     | 
| 
       9 
     | 
    
         
            -
              gem.description   = %q{ 
     | 
| 
      
 7 
     | 
    
         
            +
              gem.description   = %q{Validatable, Inheritable... And more Struct++ features :)}
         
     | 
| 
       10 
8 
     | 
    
         
             
              gem.homepage      = 'https://github.com/kachick/striuct'
         
     | 
| 
       11 
9 
     | 
    
         | 
| 
       12 
10 
     | 
    
         
             
              gem.files         = `git ls-files`.split($\)
         
     | 
| 
         @@ -17,8 +15,10 @@ Gem::Specification.new do |gem| 
     | 
|
| 
       17 
15 
     | 
    
         
             
              gem.version       = Striuct::VERSION.dup # dup for https://github.com/rubygems/rubygems/commit/48f1d869510dcd325d6566df7d0147a086905380#-P0
         
     | 
| 
       18 
16 
     | 
    
         | 
| 
       19 
17 
     | 
    
         
             
              gem.required_ruby_version = '>= 1.9.2'
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       20 
19 
     | 
    
         
             
              gem.add_runtime_dependency 'validation', '~> 0.0.3'
         
     | 
| 
       21 
20 
     | 
    
         
             
              gem.add_runtime_dependency 'keyvalidatable', '~> 0.0.3'
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              gem.add_development_dependency 'yard', '~> 0.8'
         
     | 
| 
       23 
23 
     | 
    
         
             
            end
         
     | 
| 
       24 
24 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: striuct
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3.5
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.5.1
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012-09- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-09-13 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: validation
         
     | 
| 
         @@ -48,18 +48,18 @@ dependencies: 
     | 
|
| 
       48 
48 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       49 
49 
     | 
    
         
             
                none: false
         
     | 
| 
       50 
50 
     | 
    
         
             
                requirements:
         
     | 
| 
       51 
     | 
    
         
            -
                - -  
     | 
| 
      
 51 
     | 
    
         
            +
                - - ~>
         
     | 
| 
       52 
52 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       53 
     | 
    
         
            -
                    version: 0.8 
     | 
| 
      
 53 
     | 
    
         
            +
                    version: '0.8'
         
     | 
| 
       54 
54 
     | 
    
         
             
              type: :development
         
     | 
| 
       55 
55 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       56 
56 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       57 
57 
     | 
    
         
             
                none: false
         
     | 
| 
       58 
58 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
     | 
    
         
            -
                - -  
     | 
| 
      
 59 
     | 
    
         
            +
                - - ~>
         
     | 
| 
       60 
60 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
     | 
    
         
            -
                    version: 0.8 
     | 
| 
       62 
     | 
    
         
            -
            description:  
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '0.8'
         
     | 
| 
      
 62 
     | 
    
         
            +
            description: Validatable, Inheritable... And more Struct++ features :)
         
     | 
| 
       63 
63 
     | 
    
         
             
            email:
         
     | 
| 
       64 
64 
     | 
    
         
             
            - kachick1+ruby@gmail.com
         
     | 
| 
       65 
65 
     | 
    
         
             
            executables: []
         
     |