Giter Site home page Giter Site logo

varia_model's Introduction

Berkshelf

Gem Version Matrix Testing

Manage Chef Infra cookbooks and cookbook dependencies

Warning

Berkshelf is effectively deprecated. There is no ongoing maintenance and triage of issues. No active work is being done on bugfixes. The only work being done is to maintain it so that it continues to ship and run in its existing state.

Existing users should strongly consider migrating to Policyfiles and new users should avoid using Berkshelf.

Installation

Berkshelf is now included as part of the Chef Workstation. This is fastest, easiest, and the recommended installation method for getting up and running with Berkshelf.

note: You may need to uninstall the Berkshelf gem especially if you are using a Ruby version manager you may need to uninstall all Berkshelf gems from each Ruby installation.

From Rubygems

If you are a developer or you prefer to install from Rubygems, we've got you covered.

Add Berkshelf to your repository's Gemfile:

gem 'berkshelf'

Or run it as a standalone:

$ gem install berkshelf

Usage

See docs.chef.io for up-to-date usage instructions.

CLI Usage

Berkshelf is intended to be used as a CLI tool. It is not intended to be used as a library. Other ruby code should shell out to the command line tool to use it.

Supported Platforms

Berkshelf is tested and supported on Ruby 2.4 and later.

Configuration

Berkshelf will search in specific locations for a configuration file. In order:

$PWD/.berkshelf/config.json
~/.berkshelf/config.json

You are encouraged to keep project-specific configuration in the $PWD/.berkshelf directory. A default configuration file is generated for you, but you can update the values to suit your needs.

Shell Completion

Plugins

Please see Plugins page for more information.

Getting Help

  • If you have an issue: report it on the issue tracker
  • If you have a question: visit the #chef or #berkshelf channel on irc.freenode.net

Authors

Thank you to all of our Contributors, testers, and users.

If you'd like to contribute, please see our contribution guidelines first.

varia_model's People

Contributors

danielsdeleo avatar dmerrick avatar ivey avatar lamont-granquist avatar michaelkirk avatar reset avatar sethvargo avatar tas50 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

varia_model's Issues

missing CHANGELOG

please consider adding a CHANGELOG file (http://keepachangelog.com/)

for example tracking recent requirement changes for the Ruby version I was not able to figure out the reasoning without looking through the commits (just a version bump or a need for some dependencies or needed by some code changes, ...).

Spec failure on ruby2.3

Hi,

I'm trying to run specs with ruby 2.3.0 and get a few failures:

All examples were filtered out; ignoring {:focus=>true}
.....F...............FF...FF..FF..............FF..F.FF..F......F....

Failures:

  1) VariaModel ClassMethods ::attribute sets a default value if :default option is provided
     Failure/Error: expect(subject.attributes.dig('brooke.winsor')).to eql('rhode island')

       expected: "rhode island"
            got: nil

       (compared using eql?)
     # ./spec/unit/varia_model_spec.rb:44:in `block (4 levels) in <top (required)>'

  2) VariaModel ClassMethods ::validate_kind_of success returns an array where the first element is ':ok'
     Failure/Error: expect(subject.validate_kind_of(types, model, key).first).to eql(:ok)

       expected: :ok
            got: :error

       (compared using eql?)

       Diff:
       @@ -1,2 +1,2 @@
       -:ok
       +:error
     # ./spec/unit/varia_model_spec.rb:174:in `block (5 levels) in <top (required)>'

  3) VariaModel ClassMethods ::validate_kind_of success returns an array where the second element is a blank string
     Failure/Error: expect(subject.validate_kind_of(types, model, key)[1]).to be_blank
       expected `"Expected attribute: 'nested.one' to be a type of: 'String', 'Buff::Boolean'".blank?` to return true, got false
     # ./spec/unit/varia_model_spec.rb:178:in `block (5 levels) in <top (required)>'

  4) VariaModel ClassMethods ::validate_required passes validation if the value of the attribute is false
     Failure/Error: expect(subject.validate_required(model, key).first).to eql(:ok)

       expected: :ok
            got: :error

       (compared using eql?)

       Diff:
       @@ -1,2 +1,2 @@
       -:ok
       +:error
     # ./spec/unit/varia_model_spec.rb:229:in `block (4 levels) in <top (required)>'

  5) VariaModel ClassMethods ::validate_required passes validation if the value of the attribute is not nil
     Failure/Error: expect(subject.validate_required(model, key).first).to eql(:ok)

       expected: :ok
            got: :error

       (compared using eql?)

       Diff:
       @@ -1,2 +1,2 @@
       -:ok
       +:error
     # ./spec/unit/varia_model_spec.rb:235:in `block (4 levels) in <top (required)>'

  6) VariaModel ClassMethods ::validate_required success returns an array where the first element is ':ok'
     Failure/Error: expect(subject.validate_required(model, key).first).to eql(:ok)

       expected: :ok
            got: :error

       (compared using eql?)

       Diff:
       @@ -1,2 +1,2 @@
       -:ok
       +:error
     # ./spec/unit/varia_model_spec.rb:254:in `block (5 levels) in <top (required)>'

  7) VariaModel ClassMethods ::validate_required success returns an array where the second element is a blank string
     Failure/Error: expect(subject.validate_required(model, key)[1]).to be_blank
       expected `"A value is required for attribute: 'nested.one'".blank?` to return true, got false
     # ./spec/unit/varia_model_spec.rb:258:in `block (5 levels) in <top (required)>'

  8) VariaModel Validations validate type returns false if it fails validation
     Failure/Error: expect(subject).not_to be_valid
       expected `#<#<Class:0x0000000301f3d0>:0x0000000301eb88 @_attributes_=#<VariaModel::Attributes brooke=#<VariaModel::Attributes winsor=false>>, @errors=#<Hashie::Mash>>.valid?` to return false, got true
     # ./spec/unit/varia_model_spec.rb:425:in `block (4 levels) in <top (required)>'

  9) VariaModel Validations validate type adds an error if it fails validation
     Failure/Error: expect(subject.errors.size).to eq(1)

       expected: 1
            got: 0

       (compared using ==)
     # ./spec/unit/varia_model_spec.rb:431:in `block (4 levels) in <top (required)>'

  10) VariaModel#get_attribute returns the value of the given dotted path
      Failure/Error: expect(subject.get_attribute('brooke.winsor')).to eql('sister')

        expected: "sister"
             got: nil

        (compared using eql?)
      # ./spec/unit/varia_model_spec.rb:471:in `block (3 levels) in <top (required)>'

  11) VariaModel#get_attribute returns the current value of the Proc
      Failure/Error: expect(subject.get_attribute("brooke.winsor")).to eql("BACON")

        expected: "BACON"
             got: nil

        (compared using eql?)
      # ./spec/unit/varia_model_spec.rb:480:in `block (3 levels) in <top (required)>'

  12) VariaModel#get_attribute returns the current value of the Proc each time
      Failure/Error: expect(subject.get_attribute("brooke.winsor")).to eql("ponies")

        expected: "ponies"
             got: nil

        (compared using eql?)
      # ./spec/unit/varia_model_spec.rb:486:in `block (3 levels) in <top (required)>'

  13) VariaModel#mass_assign sets the values of all matching defined attributes
      Failure/Error: expect(subject.brooke.winsor).to eql("other")

        expected: "other"
             got: "sister"

        (compared using eql?)
      # ./spec/unit/varia_model_spec.rb:533:in `block (3 levels) in <top (required)>'

  14) VariaModel#from_hash updates and returns self from a Hash
      Failure/Error: expect(subject.first_name).to eql("jamie")

        expected: "jamie"
             got: nil

        (compared using eql?)
      # ./spec/unit/varia_model_spec.rb:620:in `block (3 levels) in <top (required)>'

Finished in 0.05469 seconds (files took 0.18868 seconds to load)
68 examples, 14 failures

Failed examples:

rspec ./spec/unit/varia_model_spec.rb:41 # VariaModel ClassMethods ::attribute sets a default value if :default option is provided
rspec ./spec/unit/varia_model_spec.rb:173 # VariaModel ClassMethods ::validate_kind_of success returns an array where the first element is ':ok'
rspec ./spec/unit/varia_model_spec.rb:177 # VariaModel ClassMethods ::validate_kind_of success returns an array where the second element is a blank string
rspec ./spec/unit/varia_model_spec.rb:226 # VariaModel ClassMethods ::validate_required passes validation if the value of the attribute is false
rspec ./spec/unit/varia_model_spec.rb:232 # VariaModel ClassMethods ::validate_required passes validation if the value of the attribute is not nil
rspec ./spec/unit/varia_model_spec.rb:253 # VariaModel ClassMethods ::validate_required success returns an array where the first element is ':ok'
rspec ./spec/unit/varia_model_spec.rb:257 # VariaModel ClassMethods ::validate_required success returns an array where the second element is a blank string
rspec ./spec/unit/varia_model_spec.rb:424 # VariaModel Validations validate type returns false if it fails validation
rspec ./spec/unit/varia_model_spec.rb:428 # VariaModel Validations validate type adds an error if it fails validation
rspec ./spec/unit/varia_model_spec.rb:470 # VariaModel#get_attribute returns the value of the given dotted path
rspec ./spec/unit/varia_model_spec.rb:478 # VariaModel#get_attribute returns the current value of the Proc
rspec ./spec/unit/varia_model_spec.rb:483 # VariaModel#get_attribute returns the current value of the Proc each time
rspec ./spec/unit/varia_model_spec.rb:522 # VariaModel#mass_assign sets the values of all matching defined attributes
rspec ./spec/unit/varia_model_spec.rb:617 # VariaModel#from_hash updates and returns self from a Hash

I think there were some changes to Hash in 2.3. Maybe you could take a look?

Thanks!

Can the hashie dependency be relaxed?

Hi, I'm trying to install a gem which requires hashie >= 3.2, but I can't because varia_model is locking it at < 3.0.0. It looks like varia_model had an incompatibility with hashie > 3.0 at one point, but perhaps that can be addressed in a way other than locking the dependency to an old version?

Thanks!

Hashie 3.0 Breaking the law.

Our builders just got unhappy. It looks like this is caused by a new version of Hashie dropping, that changed its require paths around;

/mnt/jenkins/ruby/1.9.1/gems/varia_model-0.3.2/lib/varia_model/attributes.rb:2:in `require': cannot load such file -- hashie/hash_extensions (LoadError)
 from /mnt/jenkins/ruby/1.9.1/gems/varia_model-0.3.2/lib/varia_model/attributes.rb:2:in `<top (required)>'
 from /mnt/jenkins/ruby/1.9.1/gems/varia_model-0.3.2/lib/varia_model.rb:6:in `require_relative'
 from /mnt/jenkins/ruby/1.9.1/gems/varia_model-0.3.2/lib/varia_model.rb:6:in `<module:VariaModel>'
 from /mnt/jenkins/ruby/1.9.1/gems/varia_model-0.3.2/lib/varia_model.rb:4:in `<top (required)>'
 from /mnt/jenkins/ruby/1.9.1/gems/ridley-1.5.3/lib/ridley/chef_object.rb:1:in `require'
 from /mnt/jenkins/ruby/1.9.1/gems/ridley-1.5.3/lib/ridley/chef_object.rb:1:in `<top (required)>'
 from /mnt/jenkins/ruby/1.9.1/gems/ridley-1.5.3/lib/ridley.rb:69:in `require_relative'
 from /mnt/jenkins/ruby/1.9.1/gems/ridley-1.5.3/lib/ridley.rb:69:in `<module:Ridley>'
 from /mnt/jenkins/ruby/1.9.1/gems/ridley-1.5.3/lib/ridley.rb:13:in `<top (required)>'
 from /mnt/jenkins/ruby/1.9.1/gems/berkshelf-2.0.15/lib/berkshelf.rb:9:in `require'
 from /mnt/jenkins/ruby/1.9.1/gems/berkshelf-2.0.15/lib/berkshelf.rb:9:in `<top (required)>'
 from /mnt/jenkins/ruby/1.9.1/gems/berkshelf-2.0.15/bin/berks:3:in `require'
 from /mnt/jenkins/ruby/1.9.1/gems/berkshelf-2.0.15/bin/berks:3:in `<top (required)>'
 from /mnt/jenkins/workspace/cookbooks-service_platform-build/bin/berks:16:in `load'
 from /mnt/jenkins/workspace/cookbooks-service_platform-build/bin/berks:16:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.