sw2at-ui 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0fd24668685bc45a8b085956ba071d796eeaf5d
4
- data.tar.gz: 879237beed34f41f40cbd2d0abe93638762fdf03
3
+ metadata.gz: 5360d3760837456d8e76566dedc26f5d356b365e
4
+ data.tar.gz: 5d69f01c3a0c16d4578bd36135d4680103584cc6
5
5
  SHA512:
6
- metadata.gz: 5dede2ecf57af304b2f9725e62f652784dc1ecb7be0ce687859b60fed02c762831deed8c7ec93dea1ec11dfa6b399eade16e5948c18eff3e96ef2cd109f0d30d
7
- data.tar.gz: d60063da84675f70caef8de88db84c50ac1f5e560cfe3872ff47c4672b75c31b1071d4fa2d999066038beee249e64195fe70b7f0508b4e31603f14694f736942
6
+ metadata.gz: 4a189d17535d17df4a6a350e7b1813b4394e73f1514d636343b4b89ac7b4312de1b722de0e2e280e147efe46414326d6545fd38393a2bcda125c57575863e704
7
+ data.tar.gz: 80e45453d3496014e053c2989b24dce2f4b8885c05f571416f6dae4a0ff84516d6136db7015a4b771d2b2fbbb1b593967f53b476b6f4d7e681fce825980e6949
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/sw2at-ui.rb CHANGED
@@ -1,18 +1,22 @@
1
1
  module Swat
2
2
  require 'fire-model'
3
3
  require 'swat/engine'
4
+ require 'swat/ui/generators/install_generator'
4
5
 
5
6
  module UI
6
7
  require 'swat/ui/config'
7
8
  require 'swat/ui/rspec_setup'
8
9
 
9
- def self.setup(rspec_config, opts)
10
- @config = Config.new(rspec_config, opts)
11
- Fire.setup(opts)
10
+ def self.setup(opts)
11
+ config.options = opts
12
+ end
13
+
14
+ def self.rspec_config=(conf)
15
+ config.rspec_config = conf
12
16
  end
13
17
 
14
18
  def self.config
15
- @config
19
+ @config ||= Config.new
16
20
  end
17
21
 
18
22
  end
@@ -6,12 +6,14 @@ module Swat
6
6
 
7
7
  class Config
8
8
 
9
- def initialize(rspec_config, opts = {})
9
+ def rspec_config=(conf)
10
+ conf.extend RspecSetup
11
+ conf.formatter = Swat::UI::RspecSetup::Formatter
12
+ end
13
+
14
+ def options=(opts)
10
15
  @options = opts
11
- if rspec_config
12
- rspec_config.extend RspecSetup
13
- rspec_config.formatter = Swat::UI::RspecSetup::Formatter
14
- end
16
+ Fire.setup(opts)
15
17
  end
16
18
 
17
19
  def options
@@ -0,0 +1,17 @@
1
+ require 'rails/generators'
2
+
3
+ module Swat
4
+ module Ui
5
+ module Generators
6
+ class InstallGenerator < ::Rails::Generators::Base
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ desc 'Generates Swat-UI initializer.'
10
+ def install
11
+ template 'initializer.rb', 'config/initializers/swat_ui.rb'
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ Swat::UI.setup({
2
+ firebase_path: 'https://< your firebase subdomain >.firebaseio.com/v1',
3
+ collect: true,
4
+ threads: [
5
+ name: 'Main'
6
+ ]
7
+ })
@@ -2,32 +2,32 @@ namespace :swat do
2
2
 
3
3
  namespace :ci do
4
4
 
5
- desc 'SWAT CI clean'
5
+ desc 'SWAT CI clean - drop all test databases'
6
6
  task clean: :environment do
7
7
  scenarios = Swat::UI::RSpecCommands::CommandsBuilder.current_scenarios
8
8
  threads = scenarios.map do |scenario|
9
9
  Thread.new do
10
- logged_command(scenario, :clean)
10
+ run_command(scenario, :clean)
11
11
  end
12
12
  end
13
13
 
14
14
  threads.each(&:join)
15
15
  end
16
16
 
17
- desc 'SWAT CI run'
17
+ desc 'SWAT CI run - create all test databases and migrate them. Then run tests in parallel'
18
18
  task run: :environment do
19
19
  scenarios = Swat::UI::RSpecCommands::CommandsBuilder.current_scenarios
20
20
  threads = scenarios.map do |scenario|
21
21
  Thread.new do
22
- logged_command(scenario, :prepare)
23
- logged_command(scenario, :run)
22
+ run_command(scenario, :prepare)
23
+ run_command(scenario, :run)
24
24
  end
25
25
  end
26
26
 
27
27
  threads.each(&:join)
28
28
  end
29
29
 
30
- def logged_command(scenario, command)
30
+ def run_command(scenario, command)
31
31
  `#{scenario[command]}`
32
32
  end
33
33
  end
data/spec/spec_helper.rb CHANGED
@@ -18,8 +18,7 @@ require Swat::Engine.root.join 'fixtures/firebase_collection'
18
18
  RSpec.configure do |config|
19
19
 
20
20
  config.before :all do
21
- Swat::UI.setup({}, {firebase_path: ENV['TEST_FIREBASE_URL']})
22
- Fire.setup(firebase_path: (Swat::UI.config.options[:firebase_path]))
21
+ Swat::UI.setup( firebase_path: ENV['TEST_FIREBASE_URL'] )
23
22
  end
24
23
 
25
24
  def clean_firebase!
data/sw2at-ui.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sw2at-ui 0.0.4 ruby lib
5
+ # stub: sw2at-ui 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sw2at-ui"
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -391,6 +391,8 @@ Gem::Specification.new do |s|
391
391
  "lib/sw2at-ui.rb",
392
392
  "lib/swat/engine.rb",
393
393
  "lib/swat/ui/config.rb",
394
+ "lib/swat/ui/generators/install_generator.rb",
395
+ "lib/swat/ui/generators/templates/initializer.rb",
394
396
  "lib/swat/ui/rspec_commands.rb",
395
397
  "lib/swat/ui/rspec_setup.rb",
396
398
  "lib/swat/ui/stats_collector.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sw2at-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Tarasenko
@@ -587,6 +587,8 @@ files:
587
587
  - lib/sw2at-ui.rb
588
588
  - lib/swat/engine.rb
589
589
  - lib/swat/ui/config.rb
590
+ - lib/swat/ui/generators/install_generator.rb
591
+ - lib/swat/ui/generators/templates/initializer.rb
590
592
  - lib/swat/ui/rspec_commands.rb
591
593
  - lib/swat/ui/rspec_setup.rb
592
594
  - lib/swat/ui/stats_collector.rb