diff --git a/.gitignore b/.gitignore index 2aeb41c..98a5d90 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ db/*.sqlite builds/* test/files/* + +.rvmrc diff --git a/Gemfile b/Gemfile index c081165..8eb190a 100644 --- a/Gemfile +++ b/Gemfile @@ -23,8 +23,8 @@ gem "notifo" gem "tinder" case ENV["DB"] -when "mysql" then gem "mysql2", "~>0.2.0" when "postgres" then gem "pg" +else gem "mysql2", "~>0.2.0" end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index a91da5b..67b30e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,7 @@ GEM mime-types (1.17.2) mocha (0.9.12) multipart-post (1.1.0) + mysql2 (0.2.18) nokogiri (1.4.4) notifo (0.1.0) httparty (~> 0.4.5) @@ -186,6 +187,7 @@ DEPENDENCIES launchy machinist mocha + mysql2 (~> 0.2.0) nokogiri notifo open4 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index a2a10d8..dab988f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -10,6 +10,7 @@ %meta{:"http-equiv" => "Content-Type", :content => "text/html;charset=UTF-8"} %meta{:name => "keywords", :content => "keywords"} %meta{:name => "description", :content => "description"} + %link{:rel => 'shortcut icon', :href => image_path('favicon.ico'), :type => 'image/x-icon'} %body{ :style => 'padding-top: 60px;' } .navbar.navbar-fixed-top .navbar-inner diff --git a/lib/big_tuna/vcs/subversion.rb b/lib/big_tuna/vcs/subversion.rb index d408edf..5d97223 100644 --- a/lib/big_tuna/vcs/subversion.rb +++ b/lib/big_tuna/vcs/subversion.rb @@ -15,23 +15,18 @@ def self.supported? def head_info info = {} - command = "svn log -l 1" + command = "svn log -l 1 --xml" begin output = BigTuna::Runner.execute(source, command) rescue BigTuna::Runner::Error => e raise BigTuna::VCS::Error.new("Couldn't access repository log") end - log = output.stdout[1].match(/(\S+) \| (\S+) \| (.+) \|/) - info[:commit] = log[1] + log = output.stdout.join.match(/revision="(\d+)">(\S+)<\/author>(\S+)<\/date>(.*)<\/msg>/) + info[:commit] = "r#{log[1]}" info[:author] = log[2] - email = begin - YAML.load(File.read('config/email_addresses.yml'))[log[2]] - rescue - nil - end - info[:email] = email + info[:email] = log[2] # svn does not have email addresses associated info[:committed_at] = Time.parse(log[3]) - info[:commit_message] = output.stdout[3..-2] + info[:commit_message] = log[4] [info, command] end @@ -39,5 +34,12 @@ def clone(where_to) command = "svn checkout #{source} #{where_to}" BigTuna::Runner.execute(Dir.pwd, command) end + + def update(where_to) + BigTuna::Runner.execute(where_to, 'svn st --no-ignore').stdout.each do |file| + FileUtils.rm_rf(File.join(where_to, file[1..-1].strip)) if %w(? I).include?(file[0..0]) + end + BigTuna::Runner.execute(where_to, 'svn update') + end end end diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/public/images/favicon.ico b/public/images/favicon.ico new file mode 100644 index 0000000..2c3ae25 Binary files /dev/null and b/public/images/favicon.ico differ