Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Freezing a_b_plugin

  • Loading branch information...
commit 9805693ddfdd2a889783a025c05aeb6d364bcfd0 1 parent 5957cb9
@winton authored
View
24 vendor/a_b_plugin/lib/a_b_plugin.rb
@@ -58,15 +58,29 @@ def reset
Config.reset
end
+ def site(name)
+ API.sites(
+ :include => {
+ :categories => {
+ :include => {
+ :tests => {
+ :include => {
+ :variants => true
+ }
+ }
+ }
+ }
+ },
+ :only => [ :id, :category_id, :name, :tests, :variants ],
+ :name => name
+ )
+ end
+
def write_yaml
yaml = Yaml.new(Config.yaml)
yaml.configure_api
if Config.site
- site = API.sites(
- :include => { :categories => { :tests => :variants } },
- :only => [ :id, :category_id, :name, :tests, :variants ],
- :name => Config.site
- )
+ site = self.site(Config.site)
if site
yaml.data['categories'] = site['categories']
File.open(Config.yaml, 'w') do |f|
View
1  vendor/a_b_plugin/lib/a_b_plugin/helper.rb
@@ -13,7 +13,6 @@ def a_b(category=nil, test=nil, extra=nil)
"a_b_setup(#{{
:categories => Config.categories,
:env => Config.env,
- :site => Config.site,
:url => Config.url
}.to_json});"
end
Please sign in to comment.
Something went wrong with that request. Please try again.