Skip to content

Commit

Permalink
Don't raise an error on rails settings failure
Browse files Browse the repository at this point in the history
  • Loading branch information
friflaj committed Mar 16, 2012
1 parent 6d45cae commit 200e111
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 103 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ lib/labels-malformed.yaml
graph.dot
nbproject
*.rc
Gemfile.lock
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem "prawn"
gem "system_timer" if RUBY_VERSION =~ /^1\.8\./ && RUBY_PLATFORM =~ /darwin|linux/

# development gems, sorted alphabetically
group :development do
if ENV['backlogs_dev'] == 'true'

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

It would be better to keep group there.

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

My proposal is to wrap only capybara gem that causing this issue.

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

Let's just be consistent with chiliproject's installation guide:

https://www.chiliproject.org/projects/chiliproject/wiki/Installation#Installation

Run the command bundle install --without test development in the root of ChiliProject.

So the user still won't have these gems.

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

If you want this changed, you can submit a proposal to Redmine and Chiliproject.
I just think the installation shouldn't be any different from installation of Chiliproject or Redmine.

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

Redmine will include Gemfile installation approach in 1.4.0. I think It'll also require a user to opt out development and test groups.

https://github.com/edavis10/redmine/blob/master/Gemfile

https://github.com/chiliproject/chiliproject/blob/master/Gemfile

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

As far as I'm concerned the
opt-out gem groups are not the right thing.

In this case you should post your concern to the bundler's issue tracker:

http://gembundler.com/man/bundle-install.1.html

By default, bundle install will install all gems in all groups in your Gemfile(5), except those declared for a different platform.

And hopefully, bundler 2.0 will take your concern into account.

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

So, will you post your concerns here:

https://github.com/carlhuda/bundler/issues

Because it's a bundler's philosophy, not redmine's or chiliproject's

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 17, 2012

Contributor

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 18, 2012

Contributor

They've closed an issue with rationale that end-users should not use bundler at all. Bundler developers' vision is that end-users should just download zip-file with all gems prepackaged:

if you are planning on shipping your application to true end-users, I strongly suggest that you do not ask them to run bundle install at all. Instead, package your application so they can simply download it and then run it. You may want to investigate the new bundle install --standalone option that is part of Bundler 1.1, which was designed to assist with that exact problem.

So you're right.

gem 'ZenTest', "=4.5.0" # 4.6.0 has a nasty bug that breaks autotest
gem 'autotest-rails'
gem "capybara", "=0.3.9"
Expand Down
98 changes: 0 additions & 98 deletions Gemfile.lock

This file was deleted.

5 changes: 2 additions & 3 deletions lib/backlogs_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ def to_h
def safe_load
settings = Setting.plugin_redmine_backlogs.dup
if settings.is_a?(String)
Setting.connection.execute("select value from settings where name = 'plugin_redmine_backlogs'").each{|v| settings = v}
settings = YAML::load(settings)
RAILS_DEFAULT_LOGGER.error "Unable to load settings"
return {}
end
raise "Unable to load settings" if settings.is_a?(String)
settings
end
end
Expand Down
2 changes: 1 addition & 1 deletion rbl-reinstall
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ if [ "$GEMSET" = "chiliproject" ]; then
if [[ $RVM =~ [Yy] ]]; then
cd ~/redmine/chiliproject
sed -i -e"s/gem 'capybara'/gem 'capybara', '=0.3.9'/" Gemfile

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

...because in test environment you just overwrite chiliproject's Gemfile

bundle install
bundle install redmine_dev=true

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 17, 2012

Contributor

...so this is not needed

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 18, 2012

Contributor

So, is it called redmine_dev or backlogs_dev?

This comment has been minimized.

Copy link
@Vanuan

Vanuan Mar 18, 2012

Contributor

In this case bundle exec should also be run with "backlogs_dev=true". Every bundle command should be run with "backlogs_dev=true".
A more proper way (imho) is just to add a check for chiliproject or redmine: https://github.com/Vanuan/redmine_backlogs_rails3/commit/7eb672474390d0d93ceda115347120cee8368f12

This comment has been minimized.

Copy link
@retorquere

retorquere via email Mar 18, 2012

Contributor
fi

if [[ $CPINSTALL =~ [Yy] ]]; then
Expand Down

0 comments on commit 200e111

Please sign in to comment.