cheezy / fig_newton Goto Github PK
View Code? Open in Web Editor NEWEasily manage configuration from different environments.
License: MIT License
Easily manage configuration from different environments.
License: MIT License
cloned and ran bundle_install - seems to be having trouble with yml_reader, which is installed..
$ rake spec
/Users/stevejackson/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -I lib:spec -S rspec spec/fig_newton/fig_newton_spec.rb
An error occurred
NameError: uninitialized constant YmlReader::YAML
occurred at /Users/stevejackson/.rvm/gems/ruby-1.9.3-p194@data_magic/gems/yml_reader-0.2/lib/yml_reader.rb:26:in `load'
An error occurred
NameError: uninitialized constant YmlReader::YAML
occurred at /Users/stevejackson/.rvm/gems/ruby-1.9.3-p194@data_magic/gems/yml_reader-0.2/lib/yml_reader.rb:26:in `load'
Finished in 0.00116 seconds
3 examples, 3 failures
$ gem list
*** LOCAL GEMS ***
builder (3.1.4)
bundler (1.1.3)
coderay (1.0.8)
cucumber (1.2.1)
diff-lcs (1.1.3)
fuubar (1.1.0)
fuubar-cucumber (0.0.18)
gherkin (2.11.5)
growl (1.0.3)
guard (1.5.4)
guard-cucumber (1.2.2)
guard-rspec (2.1.1)
json (1.7.5)
listen (0.5.3)
lumberjack (1.0.2)
method_source (0.8.1)
pry (0.9.10)
rake (10.0.0, 0.9.2.2)
rb-fsevent (0.9.2)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
rspec-instafail (0.2.4)
rspec-mocks (2.11.3)
ruby-progressbar (1.0.2)
rubygems-bundler (0.9.0)
rvm (1.11.3.3)
slop (3.3.3)
thor (0.16.0)
yml_reader (0.2)
I get an undefined method error if I use a null or empty value in an environment file:
undefined method `password' for FigNewton:Module (NoMethodError)
./lib/pages/login_page.rb:10:in `login_to_system'
./features/step_definitions/login_steps.rb:14:in `/^I logged into the portal$/'
.\features\begin_test_setup.feature:4:in `Given I logged into the portal'
class LoginPage
include PageObject
page_url FigNewton.base_url + '//login.html'
text_field(:username, :name => 'j_username')
text_field(:password, :name => 'j_password')
button(:login, :id => 'button')
def login_to_system(username = FigNewton.username, password = FigNewton.password)
self.username = username
self.password = (password.nil? ? Settings.environment_password : password)
login
worklist = WorklistPage.new(@browser)
worklist.wait_to_load
end
end
base_url: http://awebsite.com:8080/
username: regular
password: ~
I'd like to be able to use null values if possible, using ''
just doesn't work as well
Hey @cheezy , I noticed today that loading via ENV does not support ERB. When you use FigNewton.load, the YAML is handled by your yml_reader gem which does ERB interpolation. When you use ENV['FIG_NEWTON_FILE'], FigNewton loads the yaml within itself and that method has no ERB interpolation.
I would suggest that FigNewton always call the yml_reader .load method to ensure parity regardless of entry point. yml_reader is included as a dependancy on FigNewton so this should be a quick win.
# ERB processed
FigNewton.load('data.yml')
# Non ERB processed
ENV['FIG_NEWTON_FILE']='data.yml'
Hi @cheezy,
I am using ruby ver 2.1.3 in windows 8.1 getting the following error. Can u please look into this issue.
Thanks,
Anil
F:\Selenium\RubymineProjects\SeleniumRuby\puppies>cucumber
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
uninitialized constant FigNewton::Missing::Socket (NameError)
G:/Ruby21/lib/ruby/gems/2.1.0/gems/fig_newton-0.10/lib/fig_newton/missing.rb:20:in `read_file'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/fig_newton-0.10/lib/fig_newton/missing.rb:6:in `method_missing'
F:/Selenium/RubymineProjects/SeleniumRuby/puppies/lib/pages/home_page.rb:4:in `<class:HomePage>'
F:/Selenium/RubymineProjects/SeleniumRuby/puppies/lib/pages/home_page.rb:1:in `<top (required)>'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/require_all-1.3.2/lib/require_all.rb:109:in `require'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/require_all-1.3.2/lib/require_all.rb:109:in `block in require_all'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/require_all-1.3.2/lib/require_all.rb:107:in `each'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/require_all-1.3.2/lib/require_all.rb:107:in `require_all'
F:/Selenium/RubymineProjects/SeleniumRuby/puppies/features/support/env.rb:10:in `<top (required)>'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/rb_support/rb_language.rb:94:in `load'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/rb_support/rb_language.rb:94:in `load_code_file'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime/support_code.rb:172:in `load_file'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime/support_code.rb:85:in `block in load_files!'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime/support_code.rb:84:in `each'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime/support_code.rb:84:in `load_files!'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime.rb:298:in `load_step_definitions'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/runtime.rb:67:in `run!'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/lib/cucumber/cli/main.rb:38:in `execute!'
G:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-2.0.0.beta.3/bin/cucumber:9:in `<top (required)>'
G:/Ruby21/bin/cucumber:23:in `load'
G:/Ruby21/bin/cucumber:23:in `<main>'
Hey @cheezy
I only JUST realized that FigNewton supports nesting and thus can do .to_hash. This entirely removes my dependency on your other gem DataMagic.
Based on both their current read-me's, they sell as follows:
In reality from looking at the codebase, FigNewton now does so much more.
I will try take some time to cook up a read-me update so that folks are fully aware of how powerful FigNewton can be.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.