coyote 0.5.2 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Manifest +40 -2
  2. data/bin/coyote +16 -4
  3. data/coyote.gemspec +10 -9
  4. data/lib/coyote.rb +25 -34
  5. data/lib/coyote/configuration.rb +57 -61
  6. data/lib/coyote/generator.rb +35 -35
  7. data/lib/coyote/script.rb +122 -0
  8. data/lib/coyote/scripts/coffeescript.rb +32 -0
  9. data/lib/coyote/scripts/combine.rb +54 -0
  10. data/lib/coyote/scripts/javascript.rb +4 -0
  11. data/test/assets/javascripts/app/confio.coffee +2 -0
  12. data/test/assets/javascripts/app/confio/interface.coffee +8 -0
  13. data/test/assets/javascripts/app/confio/main.coffee +4 -0
  14. data/test/assets/javascripts/lib/keystone/extensions.coffee +8 -0
  15. data/test/assets/javascripts/lib/keystone/forms.coffee +19 -0
  16. data/test/assets/javascripts/lib/keystone/utilities.coffee +2 -0
  17. data/test/assets/stylesheets/app/_confio.scss +4 -0
  18. data/test/assets/stylesheets/app/confio/_ie.scss +39 -0
  19. data/test/assets/stylesheets/app/confio/_mobile.scss +28 -0
  20. data/test/assets/stylesheets/app/confio/_print.scss +129 -0
  21. data/test/assets/stylesheets/app/confio/_screen.scss +624 -0
  22. data/test/assets/stylesheets/lib/_keystone.scss +4 -0
  23. data/test/assets/stylesheets/lib/keystone/_css3.scss +6 -0
  24. data/test/assets/stylesheets/lib/keystone/_scaffolding.scss +2 -0
  25. data/test/assets/stylesheets/lib/keystone/_typography.scss +3 -0
  26. data/test/assets/stylesheets/lib/keystone/_utilities.scss +3 -0
  27. data/test/assets/stylesheets/lib/keystone/css3/_background-clip.scss +5 -0
  28. data/test/assets/stylesheets/lib/keystone/css3/_border-radius.scss +5 -0
  29. data/test/assets/stylesheets/lib/keystone/css3/_box-shadow.scss +5 -0
  30. data/test/assets/stylesheets/lib/keystone/css3/_box-sizing.scss +5 -0
  31. data/test/assets/stylesheets/lib/keystone/css3/_opacity.scss +6 -0
  32. data/test/assets/stylesheets/lib/keystone/css3/_transition.scss +5 -0
  33. data/test/assets/stylesheets/lib/keystone/scaffolding/_reset.scss +75 -0
  34. data/test/assets/stylesheets/lib/keystone/scaffolding/_structure.scss +23 -0
  35. data/test/assets/stylesheets/lib/keystone/typography/_links.scss +66 -0
  36. data/test/assets/stylesheets/lib/keystone/typography/_lists.scss +38 -0
  37. data/test/assets/stylesheets/lib/keystone/typography/_replacement.scss +12 -0
  38. data/test/assets/stylesheets/lib/keystone/utilities/_alignment.scss +3 -0
  39. data/test/assets/stylesheets/lib/keystone/utilities/_autoclear.scss +11 -0
  40. data/test/assets/stylesheets/lib/keystone/utilities/_hoverbox.scss +32 -0
  41. data/test/assets/stylesheets/styles.scss +58 -0
  42. data/test/assets/stylesheets/vendor/_vendor.scss +0 -0
  43. data/test/public/scripts/coyote.js +93 -0
  44. data/test/public/scripts/jquery.js +4 -0
  45. data/test/public/scripts/scripts.combine +6 -0
  46. data/test/public/scripts/scripts.js +91 -0
  47. metadata +61 -19
  48. data/lib/coyote/coy_file.rb +0 -64
  49. data/lib/coyote/output.rb +0 -72
data/Manifest CHANGED
@@ -8,7 +8,6 @@ coyote.gemspec
8
8
  lib/coyote.rb
9
9
  lib/coyote/closure_compiler.rb
10
10
  lib/coyote/configuration.rb
11
- lib/coyote/coy_file.rb
12
11
  lib/coyote/fs_listener.rb
13
12
  lib/coyote/fs_listeners/darwin.rb
14
13
  lib/coyote/fs_listeners/linux.rb
@@ -16,5 +15,44 @@ lib/coyote/fs_listeners/polling.rb
16
15
  lib/coyote/fs_listeners/windows.rb
17
16
  lib/coyote/generator.rb
18
17
  lib/coyote/notification.rb
19
- lib/coyote/output.rb
18
+ lib/coyote/script.rb
19
+ lib/coyote/scripts/coffeescript.rb
20
+ lib/coyote/scripts/combine.rb
21
+ lib/coyote/scripts/javascript.rb
22
+ test/assets/javascripts/app/confio.coffee
23
+ test/assets/javascripts/app/confio/interface.coffee
24
+ test/assets/javascripts/app/confio/main.coffee
25
+ test/assets/javascripts/lib/keystone/extensions.coffee
26
+ test/assets/javascripts/lib/keystone/forms.coffee
27
+ test/assets/javascripts/lib/keystone/utilities.coffee
28
+ test/assets/stylesheets/app/_confio.scss
29
+ test/assets/stylesheets/app/confio/_ie.scss
30
+ test/assets/stylesheets/app/confio/_mobile.scss
31
+ test/assets/stylesheets/app/confio/_print.scss
32
+ test/assets/stylesheets/app/confio/_screen.scss
33
+ test/assets/stylesheets/lib/_keystone.scss
34
+ test/assets/stylesheets/lib/keystone/_css3.scss
35
+ test/assets/stylesheets/lib/keystone/_scaffolding.scss
36
+ test/assets/stylesheets/lib/keystone/_typography.scss
37
+ test/assets/stylesheets/lib/keystone/_utilities.scss
38
+ test/assets/stylesheets/lib/keystone/css3/_background-clip.scss
39
+ test/assets/stylesheets/lib/keystone/css3/_border-radius.scss
40
+ test/assets/stylesheets/lib/keystone/css3/_box-shadow.scss
41
+ test/assets/stylesheets/lib/keystone/css3/_box-sizing.scss
42
+ test/assets/stylesheets/lib/keystone/css3/_opacity.scss
43
+ test/assets/stylesheets/lib/keystone/css3/_transition.scss
44
+ test/assets/stylesheets/lib/keystone/scaffolding/_reset.scss
45
+ test/assets/stylesheets/lib/keystone/scaffolding/_structure.scss
46
+ test/assets/stylesheets/lib/keystone/typography/_links.scss
47
+ test/assets/stylesheets/lib/keystone/typography/_lists.scss
48
+ test/assets/stylesheets/lib/keystone/typography/_replacement.scss
49
+ test/assets/stylesheets/lib/keystone/utilities/_alignment.scss
50
+ test/assets/stylesheets/lib/keystone/utilities/_autoclear.scss
51
+ test/assets/stylesheets/lib/keystone/utilities/_hoverbox.scss
52
+ test/assets/stylesheets/styles.scss
53
+ test/assets/stylesheets/vendor/_vendor.scss
54
+ test/public/scripts/coyote.js
55
+ test/public/scripts/jquery.js
56
+ test/public/scripts/scripts.combine
57
+ test/public/scripts/scripts.js
20
58
  Manifest
data/bin/coyote CHANGED
@@ -18,16 +18,28 @@ OptionParser.new do |opts|
18
18
  end.parse!
19
19
 
20
20
 
21
+ def config
22
+ config = Coyote::Configuration.new @options
23
+ ARGV.shift
24
+
25
+ if ARGV.empty?
26
+ config.load_from_yaml!
27
+ else
28
+ input, output = ARGV[0].split(':', 2)
29
+ config.inputs = input
30
+ config.output = output
31
+ end
32
+
33
+ return config
34
+ end
35
+
36
+
21
37
  case ARGV.first
22
38
  when 'new'
23
39
  Coyote::generate
24
40
  when 'build'
25
- config = Coyote::Configuration.new @options
26
- config.load_from_yaml!
27
41
  Coyote::build config
28
42
  when 'watch'
29
- config = Coyote::Configuration.new @options
30
- config.load_from_yaml!
31
43
  Coyote::watch config
32
44
  else
33
45
  Coyote::usage
@@ -2,21 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{coyote}
5
- s.version = "0.5.2"
5
+ s.version = "0.6.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = [%q{Imulus}]
9
- s.date = %q{2011-10-03}
8
+ s.authors = ["Imulus"]
9
+ s.date = %q{2011-12-13}
10
+ s.default_executable = %q{coyote}
10
11
  s.description = %q{An intelligent command-line tool for combining, compressing and compiling your JavaScript and CoffeeScript files.}
11
12
  s.email = %q{developer@imulus.com}
12
- s.executables = [%q{coyote}]
13
- s.extra_rdoc_files = [%q{README.md}, %q{bin/coyote}, %q{lib/coyote.rb}, %q{lib/coyote/closure_compiler.rb}, %q{lib/coyote/configuration.rb}, %q{lib/coyote/coy_file.rb}, %q{lib/coyote/fs_listener.rb}, %q{lib/coyote/fs_listeners/darwin.rb}, %q{lib/coyote/fs_listeners/linux.rb}, %q{lib/coyote/fs_listeners/polling.rb}, %q{lib/coyote/fs_listeners/windows.rb}, %q{lib/coyote/generator.rb}, %q{lib/coyote/notification.rb}, %q{lib/coyote/output.rb}]
14
- s.files = [%q{README.md}, %q{Rakefile}, %q{bin/coyote}, %q{config/coyote-icon.png}, %q{config/coyote-usage.txt}, %q{config/coyote.yaml}, %q{coyote.gemspec}, %q{lib/coyote.rb}, %q{lib/coyote/closure_compiler.rb}, %q{lib/coyote/configuration.rb}, %q{lib/coyote/coy_file.rb}, %q{lib/coyote/fs_listener.rb}, %q{lib/coyote/fs_listeners/darwin.rb}, %q{lib/coyote/fs_listeners/linux.rb}, %q{lib/coyote/fs_listeners/polling.rb}, %q{lib/coyote/fs_listeners/windows.rb}, %q{lib/coyote/generator.rb}, %q{lib/coyote/notification.rb}, %q{lib/coyote/output.rb}, %q{Manifest}]
13
+ s.executables = ["coyote"]
14
+ s.extra_rdoc_files = ["README.md", "bin/coyote", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/configuration.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/notification.rb", "lib/coyote/script.rb", "lib/coyote/scripts/coffeescript.rb", "lib/coyote/scripts/combine.rb", "lib/coyote/scripts/javascript.rb"]
15
+ s.files = ["README.md", "Rakefile", "bin/coyote", "config/coyote-icon.png", "config/coyote-usage.txt", "config/coyote.yaml", "coyote.gemspec", "lib/coyote.rb", "lib/coyote/closure_compiler.rb", "lib/coyote/configuration.rb", "lib/coyote/fs_listener.rb", "lib/coyote/fs_listeners/darwin.rb", "lib/coyote/fs_listeners/linux.rb", "lib/coyote/fs_listeners/polling.rb", "lib/coyote/fs_listeners/windows.rb", "lib/coyote/generator.rb", "lib/coyote/notification.rb", "lib/coyote/script.rb", "lib/coyote/scripts/coffeescript.rb", "lib/coyote/scripts/combine.rb", "lib/coyote/scripts/javascript.rb", "test/assets/javascripts/app/confio.coffee", "test/assets/javascripts/app/confio/interface.coffee", "test/assets/javascripts/app/confio/main.coffee", "test/assets/javascripts/lib/keystone/extensions.coffee", "test/assets/javascripts/lib/keystone/forms.coffee", "test/assets/javascripts/lib/keystone/utilities.coffee", "test/assets/stylesheets/app/_confio.scss", "test/assets/stylesheets/app/confio/_ie.scss", "test/assets/stylesheets/app/confio/_mobile.scss", "test/assets/stylesheets/app/confio/_print.scss", "test/assets/stylesheets/app/confio/_screen.scss", "test/assets/stylesheets/lib/_keystone.scss", "test/assets/stylesheets/lib/keystone/_css3.scss", "test/assets/stylesheets/lib/keystone/_scaffolding.scss", "test/assets/stylesheets/lib/keystone/_typography.scss", "test/assets/stylesheets/lib/keystone/_utilities.scss", "test/assets/stylesheets/lib/keystone/css3/_background-clip.scss", "test/assets/stylesheets/lib/keystone/css3/_border-radius.scss", "test/assets/stylesheets/lib/keystone/css3/_box-shadow.scss", "test/assets/stylesheets/lib/keystone/css3/_box-sizing.scss", "test/assets/stylesheets/lib/keystone/css3/_opacity.scss", "test/assets/stylesheets/lib/keystone/css3/_transition.scss", "test/assets/stylesheets/lib/keystone/scaffolding/_reset.scss", "test/assets/stylesheets/lib/keystone/scaffolding/_structure.scss", "test/assets/stylesheets/lib/keystone/typography/_links.scss", "test/assets/stylesheets/lib/keystone/typography/_lists.scss", "test/assets/stylesheets/lib/keystone/typography/_replacement.scss", "test/assets/stylesheets/lib/keystone/utilities/_alignment.scss", "test/assets/stylesheets/lib/keystone/utilities/_autoclear.scss", "test/assets/stylesheets/lib/keystone/utilities/_hoverbox.scss", "test/assets/stylesheets/styles.scss", "test/assets/stylesheets/vendor/_vendor.scss", "test/public/scripts/coyote.js", "test/public/scripts/jquery.js", "test/public/scripts/scripts.combine", "test/public/scripts/scripts.js", "Manifest"]
15
16
  s.homepage = %q{http://github.com/imulus/coyote}
16
- s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Coyote}, %q{--main}, %q{README.md}]
17
- s.require_paths = [%q{lib}]
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Coyote", "--main", "README.md"]
18
+ s.require_paths = ["lib"]
18
19
  s.rubyforge_project = %q{coyote}
19
- s.rubygems_version = %q{1.8.5}
20
+ s.rubygems_version = %q{1.6.2}
20
21
  s.summary = %q{Coyote selectively concatenates your files, combining them into a single file with the option of running the output through the Google Closure Compiler before save. It can be used to observe your source files for changes and will recompile and save on the fly for easy development.}
21
22
 
22
23
  if s.respond_to? :specification_version then
@@ -1,53 +1,44 @@
1
1
  require 'yaml'
2
2
  require 'term/ansicolor'
3
- require 'coyote/coy_file'
3
+ require 'coyote/script'
4
4
  require 'coyote/configuration'
5
5
  require 'coyote/fs_listener'
6
6
  require 'coyote/generator'
7
- require 'coyote/output'
8
7
  require 'coyote/closure_compiler'
9
8
  require 'coyote/notification'
10
9
 
11
10
  include Term::ANSIColor
12
11
 
13
12
  module Coyote
14
- APP_NAME = "Coyote"
15
- VERSION = "0.5.2"
16
- ROOT_PATH = Dir.pwd
17
- CONFIG_PATH = File.expand_path(File.dirname(__FILE__) + "/../config")
18
- CONFIG_FILENAME = "coyote.yaml"
19
- CONFIG_ICON = "coyote-icon.png"
20
- USAGE_FILENAME = "coyote-usage.txt"
13
+ APP_NAME = "Coyote"
14
+ VERSION = "0.6.1"
15
+ ROOT_PATH = Dir.pwd
16
+ CONFIG_PATH = File.expand_path(File.dirname(__FILE__) + "/../config")
17
+ CONFIG_FILENAME = "coyote.yaml"
18
+ CONFIG_ICON = "coyote-icon.png"
19
+ USAGE_FILENAME = "coyote-usage.txt"
21
20
 
22
21
  module Defaults
23
22
  OUTPUT = "coyote.js"
24
23
  end
25
24
 
26
-
27
- module CoffeeScript
28
- EXTENSION = ".coffee"
29
- COMMENT = "#"
30
- end
31
-
32
-
33
- module JavaScript
34
- EXTENSION = ".js"
35
- COMMENT = "//"
25
+ def self.generate
26
+ Coyote::Generator.new.generate
36
27
  end
37
28
 
38
-
39
- def self.generate
40
- Coyote::Generator.new.generate
41
- end
29
+
42
30
 
43
31
 
44
32
  def self.build(config)
45
- output = Coyote::CoyFile.new config.output
33
+ if config.inputs == config.output
34
+ Coyote::Notification.new "Input path cannot be the same as output path\n\n", "Failure"
35
+ exit 0
36
+ end
37
+
38
+ output = Coyote::Script.select_and_init(config.output)
46
39
  output.empty!
47
40
 
48
- config.inputs.each do |file|
49
- input = Coyote::CoyFile.new file
50
- input.compile! if input.coffee?
41
+ config.inputs.each do |file, input|
51
42
  output.append input.contents
52
43
  print "+ Added #{file}\n" if config.options['verbose']
53
44
  end
@@ -58,7 +49,7 @@ module Coyote
58
49
  end
59
50
 
60
51
 
61
- def self.watch(config)
52
+ def self.watch(config)
62
53
  self.build config
63
54
 
64
55
  listener = Coyote::FSListener.select_and_init
@@ -77,12 +68,12 @@ module Coyote
77
68
  end
78
69
 
79
70
  listener.start
80
- end
71
+ end
81
72
 
82
73
 
83
- def self.usage
84
- file = File.open("#{Coyote::CONFIG_PATH}/#{Coyote::USAGE_FILENAME}", 'r')
85
- puts file.read
86
- file.close
87
- end
74
+ def self.usage
75
+ file = File.open("#{Coyote::CONFIG_PATH}/#{Coyote::USAGE_FILENAME}", 'r')
76
+ puts file.read
77
+ file.close
78
+ end
88
79
  end
@@ -1,19 +1,19 @@
1
1
  module Coyote
2
2
  class Configuration
3
3
 
4
- attr_accessor :options, :output, :source
5
- attr_reader :inputs
4
+ attr_accessor :options, :output, :source
5
+ attr_reader :inputs
6
6
 
7
- def initialize(options = {})
8
- @options = options
9
- @inputs = []
7
+ def initialize(options = {})
8
+ @options = options
9
+ @inputs = {}
10
10
  @output = Coyote::Defaults::OUTPUT
11
- end
11
+ end
12
12
 
13
13
 
14
- def should_compress?
14
+ def should_compress?
15
15
  @options['compress'] || false
16
- end
16
+ end
17
17
 
18
18
 
19
19
  def inputs=(inputs)
@@ -21,69 +21,65 @@ module Coyote
21
21
  end
22
22
 
23
23
 
24
- def add_input(input)
25
- if input.class == Array
26
- input.each do |input|
27
- find_and_add_files input
28
- end
29
- elsif input.class == String and @output != input
30
- find_and_add_files input
31
- end
32
- end
24
+ def add_input(input)
25
+ if input.class == Array
26
+ input.each do |input|
27
+ find_and_add_files input
28
+ end
29
+ elsif input.class == String and @output != input
30
+ find_and_add_files input
31
+ end
32
+ end
33
33
 
34
34
 
35
- def load_from_yaml!(yaml_file = Coyote::CONFIG_FILENAME)
36
- if File.exists?(yaml_file)
37
- begin
38
- config = YAML.load(File.open(yaml_file))
39
- if config.class == Hash && ! config.empty?
35
+ def load_from_yaml!(yaml_file = Coyote::CONFIG_FILENAME)
36
+ if File.exists?(yaml_file)
37
+ begin
38
+ config = YAML.load(File.open(yaml_file))
39
+ if config.class == Hash && ! config.empty?
40
40
  self.inputs = config['input']
41
41
  @output = config['output']
42
42
  if config['options'] && config['options'].class == Hash
43
43
  @options = config['options'].merge(@options)
44
44
  end
45
45
  @source = yaml_file
46
- else
46
+ else
47
47
  Coyote::Notification.new "Coyote configuration exists but has not been defined yet. Configure it in #{yaml_file}\n", "failure"
48
- exit(0)
49
- end
50
- rescue ArgumentError => e
48
+ exit(0)
49
+ end
50
+ rescue ArgumentError => e
51
51
  Coyote::Notification.new "Could not parse YAML: #{e.message}\n", "failure"
52
- exit
53
- end
54
- else
52
+ exit
53
+ end
54
+ else
55
55
  Coyote::Notification.new "Could not find a Coyote configuration file #{yaml_file}. Use 'coyote new' to create one.\n", "failure"
56
- exit
57
- end
58
- end
59
-
60
-
61
-
62
- private
63
-
64
- def find_and_add_files(input)
65
- Dir.glob(input).each do |file|
66
- required = find_requires file
67
- required.each do |requirement|
68
- find_and_add_files "**/#{requirement}"
69
- end
70
- if ! @inputs.include? file
71
- @inputs.push file
72
- end
73
- end
74
- end
75
-
76
-
77
- def find_requires(input_file)
78
- required = []
79
- File.open(input_file) do |file|
80
- file = file.read
81
- pattern = Regexp.new(/((\/\/|\#)=.*)(require )(.*)$/x)
82
- matches = file.scan(pattern)
83
- matches.each { |match| required.push match.last.strip }
84
- end
85
- return required
86
- end
56
+ exit
57
+ end
58
+ end
59
+
60
+
61
+
62
+ private
63
+
64
+ def find_and_add_files(path)
65
+ Dir.glob(path).each do |file|
66
+ # Grab the absolute path of the file
67
+ # so we can ensure we don't have duplicate inputs
68
+ filename = File.absolute_path(file)
69
+
70
+ script = Coyote::Script.select_and_init(filename)
71
+ script.requires.each { |path| find_and_add_files(path) }
72
+
73
+ # Check to see if the file already exists in the inputs hash
74
+ # If not, add it with the full file path as the key
75
+ if @inputs[filename].nil?
76
+ @inputs[filename] = script
77
+ end
78
+ end
79
+ end
80
+
81
+
82
+
87
83
 
88
84
  end
89
- end
85
+ end
@@ -1,49 +1,49 @@
1
1
  module Coyote
2
2
  class Generator
3
- attr_accessor :files_found
3
+ attr_accessor :files_found
4
4
 
5
- def initialize
6
- @files_found = []
7
- end
5
+ def initialize
6
+ @files_found = []
7
+ end
8
8
 
9
- def generate
10
- if config_exists?
9
+ def generate
10
+ if config_exists?
11
11
  Coyote::Notification.new "This directory is already configured for Coyote.\n", "failure"
12
- else
12
+ else
13
13
  discover_files
14
- copy_config
15
- end
16
- end
14
+ copy_config
15
+ end
16
+ end
17
17
 
18
- def discover_files
19
- js_files = File.join("**","*#{Coyote::JavaScript::EXTENSION}")
20
- cs_files = File.join("**","*#{Coyote::CoffeeScript::EXTENSION}")
21
- Dir.glob(js_files).each do |file|
22
- @files_found.push file
23
- end
24
- Dir.glob(cs_files).each do |file|
25
- @files_found.push file
26
- end
27
- end
18
+ def discover_files
19
+ js_files = File.join("**","*.js")
20
+ cs_files = File.join("**","*.coffee")
21
+ Dir.glob(js_files).each do |file|
22
+ @files_found.push file
23
+ end
24
+ Dir.glob(cs_files).each do |file|
25
+ @files_found.push file
26
+ end
27
+ end
28
28
 
29
- def config_exists?
30
- File.exists?(Coyote::CONFIG_FILENAME)
31
- end
29
+ def config_exists?
30
+ File.exists?(Coyote::CONFIG_FILENAME)
31
+ end
32
32
 
33
- def copy_config
33
+ def copy_config
34
34
  Coyote::Notification.new "\nGenerating Coyote\n"
35
35
  Coyote::Notification.new "#{@files_found.length} files discovered\n"
36
36
 
37
- File.open("#{Coyote::CONFIG_PATH}/#{Coyote::CONFIG_FILENAME}") do |file|
38
- output_file = File.open(Coyote::CONFIG_FILENAME, 'w+')
39
- generated = file.read
40
- @files_found.each do |file|
41
- generated += " - #{file}\n"
42
- end
43
- output_file.write(generated)
44
- end
37
+ File.open("#{Coyote::CONFIG_PATH}/#{Coyote::CONFIG_FILENAME}") do |file|
38
+ output_file = File.open(Coyote::CONFIG_FILENAME, 'w+')
39
+ generated = file.read
40
+ @files_found.each do |file|
41
+ generated += " - #{file}\n"
42
+ end
43
+ output_file.write(generated)
44
+ end
45
45
 
46
- Coyote::Notification.new "Coyote generated at #{Coyote::CONFIG_FILENAME}\n\n", "success"
47
- end
46
+ Coyote::Notification.new "Coyote generated at #{Coyote::CONFIG_FILENAME}\n\n", "success"
47
+ end
48
48
  end
49
- end
49
+ end