]> git.r.bdr.sh - rbdr/lyricli.rb/commitdiff
Moves the default config to /config
authorBen Beltran <redacted>
Sat, 6 Oct 2012 20:24:27 +0000 (15:24 -0500)
committerBen Beltran <redacted>
Sat, 6 Oct 2012 20:24:27 +0000 (15:24 -0500)
config/defaults.json [moved from lib/lyricli/defaults.json with 100% similarity]
lib/lyricli.rb
lib/lyricli/configuration.rb
lib/lyricli/sources/rdio.rb
lyricli-0.0.1.gem
lyricli.gemspec

index 31571c8b8ce034047c0b12f42a797f6406994fa0..73c5811a0e7a102d39f34ea2057407efb050a8c7 100755 (executable)
@@ -86,4 +86,11 @@ module Lyricli
       "There is no such Source"
     end
   end
+
+  # Returns the root of the Gem.
+  #
+  # @return [String] the root path for this gem
+  def self.root
+    File.expand_path('../..',__FILE__)
+  end
 end
index 720070ced8181acaa438851a009429e927dbc6a3..811526b5d06b62491106b00e6c1f46d01ec80fd3 100644 (file)
@@ -77,8 +77,7 @@ module Lyricli
     # Loads the default configuration from a JSON file
     def load_default_config
       # Load the default
-      path_root = File.expand_path(File.dirname(__FILE__))
-      path = File.join(path_root, @defaults_path)
+      path = File.join(::Lyricli.root, "config", @defaults_path)
 
       if File.exists?(path)
         file = File.new(path, "r")
index 76d0ed1fa60eef15b4150ce1fa0837c38e7670a4..0be89f390a7b04ec8b224ef7eea44bb01f9bbae3 100644 (file)
@@ -68,7 +68,6 @@ module Lyricli
         @config["rdio_auth_token"] = token
         token
       end
-
     end
   end
 end
index 3dc9459202107e6d5cf4ce1305449fd5b08a4165..278c0005a03a6cd3b3b3cd31482d40af33b6a486 100644 (file)
Binary files a/lyricli-0.0.1.gem and b/lyricli-0.0.1.gem differ
index 44be23ba80c1f5d09ef7bbb6503e477eb34586c3..584f808e0809ff6b9450f2062d4d53d0c835c0ac 100644 (file)
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
 
   s.files = Dir['lib/**/*.rb'] + Dir['bin/*']
   s.files += Dir['[A-Z]*'] + Dir['spec/**/*']
-  s.files += Dir['lib/**/*.json', 'lib/**/*.scpt']
+  s.files += Dir['config/**/*', 'lib/**/*.scpt']
 
   s.executables << 'lrc'
 
@@ -23,4 +23,5 @@ Gem::Specification.new do |s|
   s.add_development_dependency 'ruby-debug19', '~> 0.11.6'
   s.add_development_dependency 'yard', '~> 0.8.2.1'
   s.add_development_dependency 'thin', '~> 1.5.0'
+  s.add_development_dependency 'rspec', '~> 2.11.0'
 end