Class: JsTestServer::Configuration
- Inherits:
-
Object
- Object
- JsTestServer::Configuration
- Defined in:
- lib/js_test_server/configuration.rb
Class Attribute Summary collapse
-
.instance ⇒ Object
Returns the value of attribute instance.
Instance Attribute Summary collapse
-
#framework_name ⇒ Object
Returns the value of attribute framework_name.
-
#framework_path ⇒ Object
Returns the value of attribute framework_path.
-
#host ⇒ Object
Returns the value of attribute host.
-
#javascript_test_file_glob ⇒ Object
Returns the value of attribute javascript_test_file_glob.
-
#port ⇒ Object
Returns the value of attribute port.
-
#root_path ⇒ Object
Returns the value of attribute root_path.
-
#spec_path ⇒ Object
Returns the value of attribute spec_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #js_test_server_root_path ⇒ Object
- #rackup_path ⇒ Object
- #root_url ⇒ Object
- #suite_view_class ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/js_test_server/configuration.rb', line 18 def initialize(params={}) params = Server::DEFAULTS.dup.merge(params) @spec_path = ::File.(params[:spec_path]) @root_path = ::File.(params[:root_path]) @host = params[:host] @port = params[:port] @framework_path = params[:framework_path] @framework_name = params[:framework_name] @javascript_test_file_glob = params[:javascript_test_file_glob] end |
Class Attribute Details
.instance ⇒ Object
Returns the value of attribute instance.
4 5 6 |
# File 'lib/js_test_server/configuration.rb', line 4 def instance @instance end |
Instance Attribute Details
#framework_name ⇒ Object
Returns the value of attribute framework_name.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def framework_name @framework_name end |
#framework_path ⇒ Object
Returns the value of attribute framework_path.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def framework_path @framework_path end |
#host ⇒ Object
Returns the value of attribute host.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def host @host end |
#javascript_test_file_glob ⇒ Object
Returns the value of attribute javascript_test_file_glob.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def javascript_test_file_glob @javascript_test_file_glob end |
#port ⇒ Object
Returns the value of attribute port.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def port @port end |
#root_path ⇒ Object
Returns the value of attribute root_path.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def root_path @root_path end |
#spec_path ⇒ Object
Returns the value of attribute spec_path.
15 16 17 |
# File 'lib/js_test_server/configuration.rb', line 15 def spec_path @spec_path end |
Class Method Details
.method_missing(method_name, *args, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/js_test_server/configuration.rb', line 6 def method_missing(method_name, *args, &block) if Configuration.instance.respond_to?(method_name) Configuration.instance.send(method_name, *args, &block) else super end end |
Instance Method Details
#js_test_server_root_path ⇒ Object
45 46 47 |
# File 'lib/js_test_server/configuration.rb', line 45 def js_test_server_root_path "#{library_root_dir}/public" end |
#rackup_path ⇒ Object
53 54 55 |
# File 'lib/js_test_server/configuration.rb', line 53 def rackup_path File.("#{File.dirname(__FILE__)}/server/standalone.ru") end |
#root_url ⇒ Object
49 50 51 |
# File 'lib/js_test_server/configuration.rb', line 49 def root_url "http://#{host}:#{port}" end |
#suite_view_class ⇒ Object
29 30 31 32 33 |
# File 'lib/js_test_server/configuration.rb', line 29 def suite_view_class if framework_name JsTestServer::Server::Views::Suites.const_get(framework_name.gsub("-", "_").camelcase) end end |