dev_svn 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/svn.rb +10 -0
  2. data/spec/svn_spec.rb +12 -0
  3. metadata +1 -1
data/lib/svn.rb CHANGED
@@ -1,6 +1,16 @@
1
1
  require 'fileutils'
2
2
  require 'tmpdir'
3
3
  class Svn
4
+
5
+ def self.latest_revision
6
+ if(Dir.exists?(".svn"))
7
+ `svn info`.scan(/Last Changed Rev: ([\d]+)/).each{|m|
8
+ return m.first.to_s
9
+ }
10
+ end
11
+ "0"
12
+ end
13
+
4
14
  # publish a directory to a new subversion path
5
15
  # source_dir is the directory with the files to be published
6
16
  # destination is the new subversion path URL
data/spec/svn_spec.rb CHANGED
@@ -2,6 +2,18 @@ require_relative '../lib/svn.rb'
2
2
  require 'rake'
3
3
 
4
4
  describe Svn do
5
+ it "should be able to obtain lastest revision" do
6
+ Dir.mktmpdir{|dir|
7
+ `svnadmin create svn_test_repo 2>&1`
8
+ expect(File.exists?("#{dir}/svn_test_repo"))
9
+ svn_repo="file:///#{dir}/svn_test_repo"
10
+ #{}`svn checkout #{svn_repo} trunk`
11
+
12
+ FileUtils.rm_r('svn_test_repo')
13
+ }
14
+
15
+ end
16
+
5
17
  it "should be able to publish files to a subversion repository" do
6
18
 
7
19
  FileUtils.mkdir('tmp') if(!File.exists?('tmp'))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_svn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: