ubiquo 0.1.4 → 0.1.5

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -1,6 +1,4 @@
1
1
  module Ubiquo
2
- # TODO: Add a devel flag (git repos access)
3
- # TODO: Add fields to configure e-mails for exception_notification
4
2
  # TODO: Improve banner to inform of UBIQUO_OPTS env var merging
5
3
  # TODO: Add git needed params for repo creation on github
6
4
  class Options < Hash
@@ -16,6 +14,9 @@ module Ubiquo
16
14
  self[:locale] = :en
17
15
  self[:devel] = false
18
16
  self[:gnuine] = args.delete('--gnuine') || false
17
+ self[:exception_recipient] = "chan@ge.me"
18
+ self[:sender_address] = "chan@ge.me"
19
+
19
20
 
20
21
  @opts = OptionParser.new do |o|
21
22
  o.banner = """Usage: #{File.basename($0)} [options] application_name"
@@ -42,6 +43,16 @@ module Ubiquo
42
43
  suported_locales.each do |locale, msg|
43
44
  o.on("--#{locale.to_s}", msg) { self[:locale] = locale }
44
45
  end
46
+
47
+ o.separator "\nException notification options: "
48
+
49
+ o.on("--recipient [EMAIL]", "E-mail for exception notifications.") do |recipient|
50
+ self[:exception_recipient] = recipient
51
+ end
52
+
53
+ o.on("--sender [EMAIL]", "E-mail to use in from.") do |sender|
54
+ self[:sender_address] = sender
55
+ end
45
56
 
46
57
  o.separator "\nExtra options:"
47
58
 
@@ -46,8 +46,8 @@ def add_plugins(plugin_names, options={})
46
46
  end
47
47
  # To ask needed settings when boostraping the app
48
48
  appname = "<%= @opts[:app_name] %>"
49
- exception_recipient = "programadors@gnuine.com"
50
- sender_address = "errors@gnuine.com"
49
+ exception_recipient = "<%= @opts[:exception_recipient] %>"
50
+ sender_address = "<%= @opts[:sender_address] %>"
51
51
  # Remove rails temporary directories
52
52
  ["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
53
53
  run("rmdir ./#{f}")
@@ -47,5 +47,16 @@ class TestOptions < Test::Unit::TestCase
47
47
  version = File.read(version_file).strip
48
48
  assert_equal version, opts[:version]
49
49
  end
50
+
51
+ def test_should_be_able_to_set_default_locale
52
+ opts = Options.new(%w[ --ca myaapp ])
53
+ assert_equal :ca, opts[:locale]
54
+ end
55
+
56
+ def test_should_be_able_to_set_exception_notification_options
57
+ opts = Options.new(%w[ --recipient r@r.com --sender s@s.com myapp])
58
+ assert_equal "r@r.com", opts[:exception_recipient]
59
+ assert_equal "s@s.com", opts[:sender_address]
60
+ end
50
61
 
51
62
  end
data/ubiquo.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ubiquo}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ramon Salvad\303\263"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Ramon Salvad\xC3\xB3"