From: Ben Beltran Date: Sat, 6 Oct 2012 20:24:27 +0000 (-0500) Subject: Moves the default config to /config X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/commitdiff_plain/ac4c2838ec59a3850cfcbcef2fe141f526aaa13b?ds=sidebyside;hp=--cc Moves the default config to /config --- ac4c2838ec59a3850cfcbcef2fe141f526aaa13b diff --git a/lib/lyricli/defaults.json b/config/defaults.json similarity index 100% rename from lib/lyricli/defaults.json rename to config/defaults.json diff --git a/lib/lyricli.rb b/lib/lyricli.rb index 31571c8..73c5811 100755 --- a/lib/lyricli.rb +++ b/lib/lyricli.rb @@ -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 diff --git a/lib/lyricli/configuration.rb b/lib/lyricli/configuration.rb index 720070c..811526b 100644 --- a/lib/lyricli/configuration.rb +++ b/lib/lyricli/configuration.rb @@ -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") diff --git a/lib/lyricli/sources/rdio.rb b/lib/lyricli/sources/rdio.rb index 76d0ed1..0be89f3 100644 --- a/lib/lyricli/sources/rdio.rb +++ b/lib/lyricli/sources/rdio.rb @@ -68,7 +68,6 @@ module Lyricli @config["rdio_auth_token"] = token token end - end end end diff --git a/lyricli-0.0.1.gem b/lyricli-0.0.1.gem index 3dc9459..278c000 100644 Binary files a/lyricli-0.0.1.gem and b/lyricli-0.0.1.gem differ diff --git a/lyricli.gemspec b/lyricli.gemspec index 44be23b..584f808 100644 --- a/lyricli.gemspec +++ b/lyricli.gemspec @@ -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