minruby 1.0 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/minruby.rb +6 -6
- data/minruby.gemspec +2 -2
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b340f255579f114e1a15261de55aac35ec12877c
         | 
| 4 | 
            +
              data.tar.gz: a57a58ae0e2933d5bd35d4a4580fe58786547cfb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3f37d3ef1444db0840e31a0c4dd4ae732a99b89547312047a974d1ba0f6a2959f1e6f74e633bd0c15303cf39052d381c548d79f74d715c5a336ee3358b741edc
         | 
| 7 | 
            +
              data.tar.gz: 98d2f0c24c428f7fb319e68f8309dddabc8c7360c2df89da23dd8009c5a04a5bd1f0163aaadd795b105d9b795c62d4b4deb59b8a047b29d449263479927e8a1f
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # 『Ruby で学ぶ Ruby | 
| 1 | 
            +
            # 『Ruby で学ぶ Ruby』用補助ライブラリ
         | 
| 2 2 |  | 
| 3 3 | 
             
            ASCII.jp の Web 連載『[Ruby で学ぶ Ruby](http://ascii.jp/elem/000/001/230/1230449/)』のための補助ライブラリです。
         | 
| 4 4 |  | 
| @@ -17,7 +17,7 @@ ASCII.jp の Web 連載『[Ruby で学ぶ Ruby](http://ascii.jp/elem/000/001/230 | |
| 17 17 |  | 
| 18 18 | 
             
            ## 別のインストール方法
         | 
| 19 19 |  | 
| 20 | 
            -
            `gem` でのインストールがうまく行かない場合は、[ライブラリのファイル](https:// | 
| 20 | 
            +
            `gem` でのインストールがうまく行かない場合は、[ライブラリのファイル](https://raw.githubusercontent.com/mame/minruby/master/lib/minruby.rb)をダウンロードしてあなたのプログラムと同じフォルダに置いてください。それから、あなたのプログラムの最初の行に
         | 
| 21 21 |  | 
| 22 22 | 
             
                require "./minruby"
         | 
| 23 23 |  | 
    
        data/lib/minruby.rb
    CHANGED
    
    | @@ -27,19 +27,19 @@ class MinRubyParser | |
| 27 27 | 
             
                  ["method_call", recv, name, []]
         | 
| 28 28 | 
             
                when :fcall
         | 
| 29 29 | 
             
                  name = exp[1][1]
         | 
| 30 | 
            -
                  ["func_call", name | 
| 30 | 
            +
                  ["func_call", name]
         | 
| 31 31 | 
             
                when :method_add_arg
         | 
| 32 32 | 
             
                  call = simplify(exp[1])
         | 
| 33 33 | 
             
                  e = exp[2]
         | 
| 34 34 | 
             
                  e = e[1] || [] if e[0] == :arg_paren
         | 
| 35 35 | 
             
                  e = e[1] || [] if e[0] == :args_add_block
         | 
| 36 36 | 
             
                  e = e.map {|e_| simplify(e_) }
         | 
| 37 | 
            -
                  call[call[0] == "func_call" ? 2 : 3] = e
         | 
| 37 | 
            +
                  call[(call[0] == "func_call" ? 2 : 3)..-1] = e
         | 
| 38 38 | 
             
                  call
         | 
| 39 39 | 
             
                when :command
         | 
| 40 40 | 
             
                  name = exp[1][1]
         | 
| 41 41 | 
             
                  args = exp[2][1].map {|e_| simplify(e_) }
         | 
| 42 | 
            -
                  ["func_call", name, args]
         | 
| 42 | 
            +
                  ["func_call", name, *args]
         | 
| 43 43 | 
             
                when :if, :elsif
         | 
| 44 44 | 
             
                  cond_exp = simplify(exp[1])
         | 
| 45 45 | 
             
                  then_exp = make_stmts(exp[2])
         | 
| @@ -123,15 +123,15 @@ class MinRubyParser | |
| 123 123 | 
             
                when :array
         | 
| 124 124 | 
             
                  ["ary_new", *(exp[1] ? exp[1].map {|e_| simplify(e_) } : [])]
         | 
| 125 125 | 
             
                when :hash
         | 
| 126 | 
            -
                  kvs = []
         | 
| 126 | 
            +
                  kvs = ["hash_new"]
         | 
| 127 127 | 
             
                  if exp[1]
         | 
| 128 128 | 
             
                    exp[1][1].each do |e_|
         | 
| 129 129 | 
             
                      key = simplify(e_[1])
         | 
| 130 130 | 
             
                      val = simplify(e_[2])
         | 
| 131 | 
            -
                      kvs <<  | 
| 131 | 
            +
                      kvs << key << val
         | 
| 132 132 | 
             
                    end
         | 
| 133 133 | 
             
                  end
         | 
| 134 | 
            -
                   | 
| 134 | 
            +
                  kvs
         | 
| 135 135 | 
             
                when :void_stmt
         | 
| 136 136 | 
             
                  ["lit", nil]
         | 
| 137 137 | 
             
                when :paren
         | 
    
        data/minruby.gemspec
    CHANGED
    
    | @@ -1,12 +1,12 @@ | |
| 1 1 | 
             
            # coding: utf-8
         | 
| 2 2 | 
             
            Gem::Specification.new do |spec|
         | 
| 3 3 | 
             
              spec.name          = "minruby"
         | 
| 4 | 
            -
              spec.version       = "1.0"
         | 
| 4 | 
            +
              spec.version       = "1.0.1"
         | 
| 5 5 | 
             
              spec.authors       = ["Yusuke Endoh"]
         | 
| 6 6 | 
             
              spec.email         = ["mame@ruby-lang.org"]
         | 
| 7 7 |  | 
| 8 8 | 
             
              spec.summary       = %q{A helper library for "Ruby de manabu Ruby"}
         | 
| 9 | 
            -
              spec.description   = %q{This library provides some helper modules to implement a toy Ruby implementation.  This is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by Ruby)", in ASCII.jp}
         | 
| 9 | 
            +
              spec.description   = %q{This library provides some helper modules to implement a toy Ruby implementation.  This is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by implementing Ruby)", in ASCII.jp}
         | 
| 10 10 | 
             
              spec.homepage      = "http://github.com/mame/minruby/"
         | 
| 11 11 | 
             
              spec.license       = "MIT"
         | 
| 12 12 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: minruby
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 1.0.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Yusuke Endoh
         | 
| @@ -39,8 +39,8 @@ dependencies: | |
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 40 | 
             
                    version: '10.0'
         | 
| 41 41 | 
             
            description: This library provides some helper modules to implement a toy Ruby implementation.  This
         | 
| 42 | 
            -
              is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by  | 
| 43 | 
            -
              in ASCII.jp
         | 
| 42 | 
            +
              is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by implementing
         | 
| 43 | 
            +
              Ruby)", in ASCII.jp
         | 
| 44 44 | 
             
            email:
         | 
| 45 45 | 
             
            - mame@ruby-lang.org
         | 
| 46 46 | 
             
            executables: []
         |