Browse files

replaced addon with feature

  • Loading branch information...
1 parent 0882d5e commit 46b8d6f4c5c9aaccd8ee271f22c33c26ba409c81 @chrisbaglieri chrisbaglieri committed Oct 10, 2011
Showing with 56 additions and 56 deletions.
  1. +11 −11 README.md
  2. +4 −4 init.rb
  3. +28 −28 lib/heroku/command/labs.rb
  4. +13 −13 spec/heroku/command/labs_spec.rb
View
22 README.md
@@ -18,24 +18,24 @@ Developers not enrolled in the labs program see the following when attempting to
would make a good tester, and what features you are
interested in.
-Viewing the particular experimental addons a particular app has enabled. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same patterns as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
+Viewing the particular features a particular app has enabled. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same pattern as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
$ heroku labs --app myapp
Foo
Bar
- 'heroku labs:info [addon]' to see the details of an addon
- 'heroku labs:enable [addon] --app myapp' to enable an addon
- 'heroku labs:disable [addon] --app myapp' to disable an addon
+ 'heroku labs:info feature' to see the details of a feature
+ 'heroku labs:enable feature --app myapp' to enable a feature
+ 'heroku labs:disable feature --app myapp' to disable a feature
-Viewing the details of a particular experimental addon. This command does not require an application context.
+Viewing the details of a particular feature. This command does not require an application context.
$ heroku labs:info Bar
Details: http://addons.heroku.com/bar
Docs: http://devcenter.heroku.com/articles/bar (username/password)
Support: support@bar.com
-Enabling a particular experimental addon for a particular app. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same patterns as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
+Enabling a particular feature for a particular app. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same pattern as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
$ heroku labs:enable Bar --app myapp
Enabled bar for myapp
@@ -44,7 +44,7 @@ Enabling a particular experimental addon for a particular app. Note that '--app'
Foo
Bar *
-Disabling a particular experimental addon for a particular app. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same patterns as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
+Disabling a particular feature for a particular app. Note that '--app' is an optional argument; when not provided, the context of the current application is assumed (same pattern as with most other Heroku commands), if a context is missing, a friendly error message is displayed.
$ heroku labs:disable Bar --app myapp
Disabled bar for myapp
@@ -56,7 +56,7 @@ Disabling a particular experimental addon for a particular app. Note that '--app
Proposed Core Application Updates
---------------------------------
- heroku.list_experimental_addons(app) # lists the experimental addons for app, enabled addons marked
- heroku.get_experimental_addon(addon) # gets the details of addon, consider generisizing to get_addon
- heroku.enable_experimental_addon(app, addon) # enables addon for app
- heroku.disable_experimental_addon(app, addon) # disables addon for app
+ heroku.list_features(app) # lists the features for app, enabled features marked
+ heroku.get_feature(feature_name) # gets the details of a feature
+ heroku.enable_feature(app, feature_name) # enables feature for app
+ heroku.disable_feature(app, feature_name) # disables feature for app
View
8 init.rb
@@ -1,8 +1,8 @@
require 'heroku/command/labs'
Heroku::Command::Help.group('Labs') do |group|
- group.command('labs --app myapp', 'Lists addons')
- group.command('labs:info [addon]', 'Displays details of an addon')
- group.command('labs:enable [addon] --app myapp', 'Enables an addon')
- group.command('labs:disable [addon] --app myapp', 'Disables an addon')
+ group.command('labs --app myapp', 'Lists features')
+ group.command('labs:info feature', 'Displays details of a feature')
+ group.command('labs:enable feature --app myapp', 'Enables a feature')
+ group.command('labs:disable feature --app myapp', 'Disables a feature')
end
View
56 lib/heroku/command/labs.rb
@@ -2,11 +2,11 @@ class Heroku::Command::Labs < Heroku::Command::BaseWithApp
# labs
#
- # lists addons
+ # lists features
#
def index
- addons = heroku.list_experimental_addons(app)
- if addons.empty?
+ features = heroku.list_features(app)
+ if features.empty?
display " You are currently not enrolled in our labs program."
display " If you would like to participate, and are willing"
display " to commit to providing helpful feedback and testing"
@@ -15,51 +15,51 @@ def index
display " would make a good tester, and what features you are"
display " interested in."
else
- lines = addons.map do |addon|
- row = [addon['enabled'] ? '*' : ' ', addon['name']]
+ lines = features.map do |feature|
+ row = [feature['enabled'] ? '*' : ' ', feature['name']]
row.join(' ')
end
display lines.join("\n")
display
- display " 'heroku labs:info [addon]' to see the details of an addon"
- display " 'heroku labs:enable [addon] --app myapp' to enable an addon"
- display " 'heroku labs:disable [addon] --app myapp' to disable an addon"
+ display " 'heroku labs:info feature' to see the details of a feature"
+ display " 'heroku labs:enable feature --app myapp' to enable a feature"
+ display " 'heroku labs:disable feature --app myapp' to disable a features"
end
end
- # labs:info [addon]
+ # labs:info feature
#
- # displays details of an addon
+ # displays details of a feature
#
def info
- addon_name = args.shift.downcase rescue nil
- fail("Usage: heroku labs:info [addon]") if addon_name.to_s.strip.empty?
- addon = heroku.get_experimental_addon(addon_name)
- display " Details: #{addon['details']}"
- display " Docs: #{addon['documentation']}"
- display " Support: #{addon['support']}"
+ feature_name = args.shift.downcase rescue nil
+ fail("Usage: heroku labs:info feature") if feature_name.to_s.strip.empty?
+ feature = heroku.get_feature(feature_name)
+ display " Details: #{feature['details']}"
+ display " Docs: #{feature['documentation']}"
+ display " Support: #{feature['support']}"
end
- # labs:enable [addon]
+ # labs:enable feature
#
- # enables an addon
+ # enables a feature
#
def enable
- addon_name = args.shift.downcase rescue nil
- fail("Usage: heroku labs:enable [addon]") if addon_name.to_s.strip.empty?
- heroku.enable_experimental_addon(app, addon_name)
- display "Enabled #{addon_name} for #{app}.#{heroku.host}"
+ feature_name = args.shift.downcase rescue nil
+ fail("Usage: heroku labs:enable feature") if feature_name.to_s.strip.empty?
+ heroku.enable_feature(app, feature_name)
+ display "Enabled #{feature_name} for #{app}.#{heroku.host}"
end
- # labs:disable [addon]
+ # labs:disable feature
#
- # disables an addon
+ # disables a feature
#
def disable
- addon_name = args.shift.downcase rescue nil
- fail("Usage: heroku labs:disable [addon]") if addon_name.to_s.strip.empty?
- heroku.disable_experimental_addon(app, addon_name)
- display "Disabled #{addon_name} for #{app}.#{heroku.host}"
+ feature_name = args.shift.downcase rescue nil
+ fail("Usage: heroku labs:disable feature") if feature_name.to_s.strip.empty?
+ heroku.disable_feature(app, feature_name)
+ display "Disabled #{feature_name} for #{app}.#{heroku.host}"
end
end
View
26 spec/heroku/command/labs_spec.rb
@@ -8,45 +8,45 @@ module Heroku::Command
@labs.heroku.stub!(:info).and_return({})
end
- it "lists no experimental addons if developer is not enrolled" do
- @labs.heroku.should_receive(:list_experimental_addons).with('myapp').and_return([])
+ it "lists no features if developer is not enrolled" do
+ @labs.heroku.should_receive(:list_features).with('myapp').and_return([])
@labs.index
end
- it "lists experimental addons if developer enrolled" do
- @labs.heroku.should_receive(:list_experimental_addons).with('myapp')
+ it "lists features if developer is enrolled" do
+ @labs.heroku.should_receive(:list_features).with('myapp')
@labs.index
end
- it "displays details of an experimental addon" do
+ it "displays details of a feature" do
@labs.stub!(:args).and_return(['example'])
- @labs.heroku.should_receive(:get_experimental_addon).with('example')
+ @labs.heroku.should_receive(:get_feature).with('example')
@labs.info
end
- it "shows usage if no addon name specified for info" do
+ it "shows usage if no feature name is specified for info" do
@labs.stub!(:args).and_return([])
lambda { @labs.info }.should raise_error(CommandFailed, /Usage:/)
end
- it "enables an experimental addon" do
+ it "enables a feature" do
@labs.stub!(:args).and_return(['example'])
- @labs.heroku.should_receive(:enable_experimental_addon).with('myapp', 'example')
+ @labs.heroku.should_receive(:enable_feature).with('myapp', 'example')
@labs.enable
end
- it "shows usage if no addon name specified for enable" do
+ it "shows usage if no feature name is specified for enable" do
@labs.stub!(:args).and_return([])
lambda { @labs.enable }.should raise_error(CommandFailed, /Usage:/)
end
- it "disables an experimental addon" do
+ it "disables a feature" do
@labs.stub!(:args).and_return(['example'])
- @labs.heroku.should_receive(:disable_experimental_addon).with('myapp', 'example')
+ @labs.heroku.should_receive(:disable_feature).with('myapp', 'example')
@labs.disable
end
- it "shows usage if no addon name specified for disable" do
+ it "shows usage if no feature name is specified for disable" do
@labs.stub!(:args).and_return([])
lambda { @labs.disable }.should raise_error(CommandFailed, /Usage:/)
end

0 comments on commit 46b8d6f

Please sign in to comment.