lib/rflow/configuration/ruby_dsl.rb in rflow-1.0.1 vs lib/rflow/configuration/ruby_dsl.rb in rflow-1.1.0
- old
+ new
@@ -8,11 +8,11 @@
private
attr_accessor :setting_specs, :shard_specs, :connection_specs, :default_shard
public
def initialize
- @default_shard = {:name => "DEFAULT", :type => :process, :count => 1, :components => []}
+ @default_shard = {:name => 'DEFAULT', :type => :process, :count => 1, :components => []}
@current_shard = default_shard
@setting_specs = []
@shard_specs = [default_shard]
@connection_specs = []
@@ -25,12 +25,12 @@
setting_specs << {:name => name.to_s, :value => value.to_s, :config_line => get_config_line(caller)}
end
# DSL method to specify a shard block for either a process or thread
def shard(name, options = {})
- raise ArgumentError, "Cannot use DEFAULT as a shard name" if name == 'DEFAULT'
- raise ArgumentError, "Cannot nest shards" if @current_shard != default_shard
+ raise ArgumentError, 'Cannot use DEFAULT as a shard name' if name == 'DEFAULT'
+ raise ArgumentError, 'Cannot nest shards' if @current_shard != default_shard
type = if options[:thread] || options[:type] == :thread; :thread
else :process
end
@@ -64,10 +64,10 @@
end
# DSL method to specify a connection between a
# component/output_port and another component/input_port. The
# component/port specification is a string where the names of
- # the two elements are separated by '#', and the "connection" is
+ # the two elements are separated by '#', and the 'connection' is
# specified by a Ruby Hash, i.e.:
# connect 'componentA#output' => 'componentB#input'
# Array ports are specified with an key suffix in standard
# progamming syntax, i.e.
# connect 'componentA#arrayport[2]' => 'componentB#in[1]'