Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec
24 changes: 12 additions & 12 deletions configure.gemspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-configure'
s.version = '2.0.0.1'
s.summary = 'Generates class level configure methods'
s.description = ' '
s.name = "evt-configure"
s.version = "2.0.0.1"
s.summary = "Generates class level configure methods"
s.description = " "

s.authors = ['The Eventide Project']
s.email = '[email protected]'
s.homepage = 'https://github.com/eventide-project/configure'
s.licenses = ['MIT']
s.authors = ["The Eventide Project"]
s.email = "[email protected]"
s.homepage = "https://github.com/eventide-project/configure"
s.licenses = ["MIT"]

s.require_paths = ['lib']
s.files = Dir.glob('{lib}/**/*')
s.require_paths = ["lib"]
s.files = Dir.glob("{lib}/**/*")
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.3.3'
s.required_ruby_version = ">= 2.3.3"

s.add_development_dependency 'test_bench'
s.add_development_dependency "test_bench"
end
4 changes: 2 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require_relative './load_path'
require_relative "./load_path"

require 'configure'
require "configure"
8 changes: 4 additions & 4 deletions lib/configure.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'ostruct'
require "ostruct"

require 'configure/macro'
require 'configure/activate'
require 'configure/configure'
require "configure/macro"
require "configure/activate"
require "configure/configure"
14 changes: 7 additions & 7 deletions lib/configure/controls.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'configure/controls/factory_method'
require "configure/controls/factory_method"

require 'configure/controls/example'
require "configure/controls/example"

require 'configure/controls/extended'
require 'configure/controls/included'
require "configure/controls/extended"
require "configure/controls/included"

require 'configure/controls/no_arguments'
require 'configure/controls/positional_argument'
require 'configure/controls/keyword_argument'
require "configure/controls/no_arguments"
require "configure/controls/positional_argument"
require "configure/controls/keyword_argument"
6 changes: 3 additions & 3 deletions load_path.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bundler_standalone_loader = 'gems/bundler/setup'
bundler_standalone_loader = "gems/bundler/setup"

begin
require_relative bundler_standalone_loader
Expand All @@ -8,10 +8,10 @@
Bundler.require
end

lib_dir = File.expand_path('lib', __dir__)
lib_dir = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)

libraries_dir = ENV['LIBRARIES_HOME']
libraries_dir = ENV["LIBRARIES_HOME"]
unless libraries_dir.nil?
libraries_dir = File.expand_path(libraries_dir)
$LOAD_PATH.unshift libraries_dir unless $LOAD_PATH.include?(libraries_dir)
Expand Down
6 changes: 3 additions & 3 deletions test/automated.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative './test_init'
require_relative "./test_init"

TestBench::Run.(
'test/automated',
exclude: '{_*,*sketch*,*_init,*_tests}.rb'
"test/automated",
exclude: "{_*,*sketch*,*_init,*_tests}.rb"
) or exit(false)
2 changes: 1 addition & 1 deletion test/automated/activation/activation.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../automated_init'
require_relative "../automated_init"

context "Activation" do
receiver = OpenStruct.new
Expand Down
2 changes: 1 addition & 1 deletion test/automated/activation/extend.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../automated_init'
require_relative "../automated_init"

context "Activation" do
context "Extend" do
Expand Down
2 changes: 1 addition & 1 deletion test/automated/activation/include.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../automated_init'
require_relative "../automated_init"

context "Activation" do
context "Include" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../automated_init'
require_relative "../automated_init"

context "Activation" do
context "Optional Constructor Parameter" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../automated_init'
require_relative "../automated_init"

context "Activation" do
context "Optional Factory Method Parameter" do
Expand Down
2 changes: 1 addition & 1 deletion test/automated/automated_init.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require_relative '../test_init'
require_relative "../test_init"
4 changes: 2 additions & 2 deletions test/automated/configuring_receiver.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative './automated_init'
require_relative "./automated_init"

context "Configuring Receiver" do
control_value = 'some-value'
control_value = "some-value"
receiver = OpenStruct.new

context "No Arguments" do
Expand Down
2 changes: 1 addition & 1 deletion test/automated/factory_method.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative './automated_init'
require_relative "./automated_init"

context "Configuring classes with factory method" do
context "factory_method parameter" do
Expand Down
8 changes: 4 additions & 4 deletions test/automated/generate_factory_method.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative './automated_init'
require_relative "./automated_init"

context "Generate the factory method if a block is supplied" do
context "Default factory method name" do
Expand Down Expand Up @@ -61,19 +61,19 @@ def initialize(arg1, arg2)

receiver = OpenStruct.new

instance = control_class.configure receiver, 'value 1', 'value 2'
instance = control_class.configure receiver, "value 1", "value 2"

test "Factory method is used to construct the class" do
assert control_class.factory_method_called?
end

context "Args are used to instantiate the class" do
test "arg1" do
assert(instance.arg1 == 'value 1')
assert(instance.arg1 == "value 1")
end

test "arg2" do
assert(instance.arg2 == 'value 2')
assert(instance.arg2 == "value 2")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/automated/macro_called_more_than_once.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative './automated_init'
require_relative "./automated_init"

context "Invoking macro does not override the macro itself" do
control_class = Class.new do
Expand Down
2 changes: 1 addition & 1 deletion test/automated/subclass.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative './automated_init'
require_relative "./automated_init"

context "Defining the configure method on a subclass" do
control_class = Class.new(Controls::NoArguments::Example) do
Expand Down
18 changes: 9 additions & 9 deletions test/test_init.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
ENV['CONSOLE_DEVICE'] ||= 'stdout'
ENV['LOG_COLOR'] ||= 'on'
ENV["CONSOLE_DEVICE"] ||= "stdout"
ENV["LOG_COLOR"] ||= "on"

if ENV['LOG_LEVEL']
ENV['LOGGER'] ||= 'on'
if ENV["LOG_LEVEL"]
ENV["LOGGER"] ||= "on"
else
ENV['LOG_LEVEL'] ||= 'trace'
ENV["LOG_LEVEL"] ||= "trace"
end

ENV['LOGGER'] ||= 'off'
ENV["LOGGER"] ||= "off"

puts RUBY_DESCRIPTION

require_relative '../init.rb'
require_relative "../init.rb"

require 'test_bench'; TestBench.activate
require "test_bench"; TestBench.activate

require 'configure/controls'
require "configure/controls"

Controls = Configure::Controls