bard 0.42.0 → 0.43.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.
- checksums.yaml +4 -4
- data/install_files/specified_node.rb +13 -27
- data/install_files/specified_yarn.rb +6 -9
- data/install_files/yarn +5 -0
- data/lib/bard/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1d2474f2bb81c20829b7ca09fff60ecfce5591b079eabc5b278f84264a85af47
         | 
| 4 | 
            +
              data.tar.gz: a2a64f425e92a13bd2fb13a8e31cf26c6515eb382612b5bb805e626be2df7447
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e6d10bdee8db0cd11175325e41ae74f34543f20be0b5dd6f37ef52e51c67ffad1690d7a608df746d811846044c3627efee8328ae2b6c6cea5db45122db8e58fd
         | 
| 7 | 
            +
              data.tar.gz: 05e02cc97bc25bb51a6794effd9a29ad466fab9909193028b3d6151c51cb0e20224639a40d6732c86b0307084743a9a113aae5a6f61eff6ff954d8779edf9b2e
         | 
| @@ -1,45 +1,31 @@ | |
| 1 1 | 
             
            module SpecifiedNode
         | 
| 2 | 
            -
              class NVMError < StandardError; end
         | 
| 3 | 
            -
             | 
| 4 | 
            -
              NVM_PATH = File.expand_path("~/.nvm/nvm.sh")
         | 
| 5 | 
            -
             | 
| 6 2 | 
             
              extend self
         | 
| 7 3 |  | 
| 4 | 
            +
              NODE_VERSION = "v12.16.1"
         | 
| 5 | 
            +
              NODE_PATH = "tmp/node-#{NODE_VERSION}-linux-x64/bin/node"
         | 
| 6 | 
            +
             | 
| 8 7 | 
             
              def ensure!
         | 
| 9 | 
            -
                install_nvm unless nvm_installed?
         | 
| 10 | 
            -
                restart unless nvm_active?
         | 
| 11 8 | 
             
                install_node unless node_installed?
         | 
| 12 | 
            -
                 | 
| 9 | 
            +
                install_binstub
         | 
| 10 | 
            +
                "bin/node --version"
         | 
| 13 11 | 
             
              end
         | 
| 14 12 |  | 
| 15 13 | 
             
              private
         | 
| 16 14 |  | 
| 17 | 
            -
              def install_nvm
         | 
| 18 | 
            -
                system("curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash")\
         | 
| 19 | 
            -
                  or raise "Couldn't install nvm"
         | 
| 20 | 
            -
              end
         | 
| 21 | 
            -
             | 
| 22 | 
            -
              def nvm_installed?
         | 
| 23 | 
            -
                File.exist?(NVM_PATH)
         | 
| 24 | 
            -
              end
         | 
| 25 | 
            -
             | 
| 26 15 | 
             
              def install_node
         | 
| 27 | 
            -
                 | 
| 28 | 
            -
              end
         | 
| 29 | 
            -
             | 
| 30 | 
            -
              def node_installed?
         | 
| 31 | 
            -
                nvm "use"
         | 
| 16 | 
            +
                system("wget -cO- https://nodejs.org/dist/#{NODE_VERSION}/node-#{NODE_VERSION}-linux-x64.tar.xz | tar xJ -C tmp/")
         | 
| 32 17 | 
             
              end
         | 
| 33 18 |  | 
| 34 | 
            -
              def  | 
| 35 | 
            -
                 | 
| 19 | 
            +
              def install_binstub
         | 
| 20 | 
            +
                system("cd bin && ln -fs ../#{NODE_PATH}")
         | 
| 36 21 | 
             
              end
         | 
| 37 22 |  | 
| 38 | 
            -
              def  | 
| 39 | 
            -
                 | 
| 23 | 
            +
              def node_installed?
         | 
| 24 | 
            +
                File.exist?(NODE_PATH) && `#{NODE_PATH} --version`.chomp == NODE_VERSION
         | 
| 40 25 | 
             
              end
         | 
| 41 26 |  | 
| 42 | 
            -
              def  | 
| 43 | 
            -
                 | 
| 27 | 
            +
              def binstub_installed?
         | 
| 28 | 
            +
                File.exist?("bin/node")
         | 
| 44 29 | 
             
              end
         | 
| 45 30 | 
             
            end
         | 
| 31 | 
            +
             | 
| @@ -1,34 +1,31 @@ | |
| 1 1 | 
             
            module SpecifiedYarn
         | 
| 2 2 | 
             
              extend self
         | 
| 3 3 |  | 
| 4 | 
            -
               | 
| 4 | 
            +
              YARN_VERSION = "v1.22.0"
         | 
| 5 | 
            +
              YARN_PATH = "tmp/yarn-#{YARN_VERSION}/bin/yarn.js"
         | 
| 5 6 |  | 
| 6 7 | 
             
              def ensure!
         | 
| 7 8 | 
             
                install_yarn unless yarn_installed?
         | 
| 8 | 
            -
                install_binstub | 
| 9 | 
            +
                install_binstub
         | 
| 9 10 | 
             
                "bin/yarn install"
         | 
| 10 11 | 
             
              end
         | 
| 11 12 |  | 
| 12 13 | 
             
              private
         | 
| 13 14 |  | 
| 14 15 | 
             
              def install_yarn
         | 
| 15 | 
            -
                system(". | 
| 16 | 
            +
                system("wget -cO- https://github.com/yarnpkg/yarn/releases/download/#{YARN_VERSION}/yarn-#{YARN_VERSION}.tar.gz | tar -xz -C tmp/")
         | 
| 16 17 | 
             
              end
         | 
| 17 18 |  | 
| 18 19 | 
             
              def install_binstub
         | 
| 19 | 
            -
                system("cd bin && ln - | 
| 20 | 
            +
                system("cd bin && ln -fs ../#{YARN_PATH}")
         | 
| 20 21 | 
             
              end
         | 
| 21 22 |  | 
| 22 23 | 
             
              def yarn_installed?
         | 
| 23 | 
            -
                File.exist?(YARN_PATH) &&  | 
| 24 | 
            +
                File.exist?(YARN_PATH) && `bin/node #{YARN_PATH} --version`.chomp == YARN_VERSION[1..-1]
         | 
| 24 25 | 
             
              end
         | 
| 25 26 |  | 
| 26 27 | 
             
              def binstub_installed?
         | 
| 27 28 | 
             
                File.exist?("bin/yarn")
         | 
| 28 29 | 
             
              end
         | 
| 29 | 
            -
             | 
| 30 | 
            -
              def version
         | 
| 31 | 
            -
                File.read("package.json")[/"yarn": "([0-9\.]+)"/, 1]
         | 
| 32 | 
            -
              end
         | 
| 33 30 | 
             
            end
         | 
| 34 31 |  | 
    
        data/install_files/yarn
    ADDED
    
    
    
        data/lib/bard/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bard
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.43.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Micah Geisel
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-04- | 
| 11 | 
            +
            date: 2020-04-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: thor
         | 
| @@ -143,6 +143,7 @@ files: | |
| 143 143 | 
             
            - install_files/specified_node.rb
         | 
| 144 144 | 
             
            - install_files/specified_ruby.rb
         | 
| 145 145 | 
             
            - install_files/specified_yarn.rb
         | 
| 146 | 
            +
            - install_files/yarn
         | 
| 146 147 | 
             
            - lib/bard.rb
         | 
| 147 148 | 
             
            - lib/bard/base.rb
         | 
| 148 149 | 
             
            - lib/bard/ci.rb
         |