require 'connfu/listener_channel' module Connfu ## # This module helps a client to manage connFu applications module Cli module Generator VOICE_CHANNEL=< VOICE_CHANNEL, :sms => SMS_CHANNEL, :twitter => TWITTER_CHANNEL, :rss => RSS_CHANNEL} code = APPLICATION_TEMPLATE.dup if channels.nil? channels = channels_templates.values.join else channels.delete_if{|channel| !Connfu::ListenerChannel::CHANNEL_TYPES.include?(channel)} channels = channels.map{|item| channels_templates[item]}.join end values = { :channels => channels, :token => (token.nil? || token.empty?) ? "YOUR-VALID-CONNFU-TOKEN" : token } code.gsub!(/%\{(\w+)\}/) do |match| key = $1 values[key.to_sym] end Dir.mkdir(name) Dir.chdir(name) do File.open(file_name, 'w') do |f| f.write(code) end end end # end:run end # end class level end # end module Generator end # end module Cli end