git-dropbox 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ pkg/
3
+ vendor/cache/*.gem
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
data/ChangeLog.md ADDED
@@ -0,0 +1,4 @@
1
+ ### 0.1.0 / 2012-08-02
2
+
3
+ * Initial release:
4
+
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Lukasz Kaniowski
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # git-dropbox
2
+
3
+ * [Homepage](https://github.com/lukasz-kaniowski/git-dropbox#readme)
4
+ * [Issues](https://github.com/lukasz-kaniowski/git-dropbox/issues)
5
+ * [Documentation](http://rubydoc.info/gems/git-dropbox/frames)
6
+ * [Email](mailto:lukasz.kaniowski at gmail.com)
7
+
8
+ ## Description
9
+
10
+ Gem mirrors your git repositorys in dropbox folder. It's based on shell script from this [repository](https://github.com/agnoster/git-dropbox)
11
+
12
+ ## Features
13
+
14
+ ## Examples
15
+
16
+ require 'git/dropbox'
17
+
18
+ ## Requirements
19
+
20
+ ## Install
21
+
22
+ $ gem install git-dropbox
23
+
24
+ ## Copyright
25
+
26
+ Copyright (c) 2012 Lukasz Kaniowski
27
+
28
+ See LICENSE.txt for details.
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'bundler'
7
+ rescue LoadError => e
8
+ warn e.message
9
+ warn "Run `gem install bundler` to install Bundler."
10
+ exit -1
11
+ end
12
+
13
+ begin
14
+ Bundler.setup(:development)
15
+ rescue Bundler::BundlerError => e
16
+ warn e.message
17
+ warn "Run `bundle install` to install missing gems."
18
+ exit e.status_code
19
+ end
20
+
21
+ require 'rake'
22
+
23
+ require 'rubygems/tasks'
24
+ Gem::Tasks.new
25
+
26
+ require 'rspec/core/rake_task'
27
+ RSpec::Core::RakeTask.new
28
+
29
+ task :test => :spec
30
+ task :default => :spec
data/bin/git-dropbox ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'git/dropbox/cli'
7
+ rescue LoadError => e
8
+ warn 'Could not load "git/dropbox/cli"'
9
+ exit -1
10
+ end
11
+
12
+ Git::Dropbox::CLI.start
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ require File.expand_path('../lib/git/dropbox/version', __FILE__)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "git-dropbox"
7
+ gem.version = Git::Dropbox::VERSION
8
+ gem.summary = %q{mirrors git into dropbox}
9
+ gem.description = %q{Gem mirrors your git repositorys in dropbox folder}
10
+ gem.license = "MIT"
11
+ gem.authors = ["Lukasz Kaniowski"]
12
+ gem.email = "lukasz.kaniowski@gmail.com"
13
+ gem.homepage = "https://github.com/lukasz-kaniowski/git-dropbox#readme"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency 'thor', '~> 0.15.4'
21
+
22
+ gem.add_development_dependency 'bundler', '~> 1.0'
23
+ gem.add_development_dependency 'rake', '~> 0.8'
24
+ gem.add_development_dependency 'rspec', '~> 2.4'
25
+ gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
26
+ end
@@ -0,0 +1 @@
1
+ require 'git/dropbox/version'
@@ -0,0 +1,21 @@
1
+ require "thor"
2
+
3
+ module Git
4
+ module Dropbox
5
+ class CLI < Thor
6
+
7
+ DROPBOX_GIT_CMD = File.join(File.dirname(__FILE__), "git-dropbox-org.sh")
8
+
9
+ desc 'sync', 'Syncs current git repository to dropbox folder'
10
+
11
+ def sync
12
+ system DROPBOX_GIT_CMD
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+
19
+ #Git::Dropbox::CLI.start
20
+
21
+
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+
3
+ # original file from https://github.com/agnoster/git-dropbox/blob/master/git-dropbox.sh
4
+
5
+ FOLDER=`git config dropbox.folder`
6
+
7
+ if [ ! "$FOLDER" -o ! -d "$FOLDER" ]; then
8
+ FOLDER=""
9
+ # Running for the first time
10
+ if [ -d "$HOME/Dropbox" ]; then
11
+ DEFAULT="$HOME/Dropbox/git"
12
+ fi
13
+ echo "# git-dropbox: initial setup"
14
+ while [ ! "$FOLDER" ]; do
15
+ read -p "Where should git repositories be saved? [$DEFAULT] " -e FOLDER
16
+ if [ ! "$FOLDER" ]; then
17
+ FOLDER="$DEFAULT"
18
+ echo "Choosing default: $FOLDER"
19
+ fi
20
+ done
21
+
22
+ mkdir -p $FOLDER
23
+ if [ ! "$FOLDER" ]; then
24
+ echo "$FOLDER does not exist. Check that you have permissions to create it."
25
+ exit 1
26
+ fi
27
+
28
+ git config --global dropbox.folder "$FOLDER"
29
+ echo "Set $FOLDER as the location for your dropbox git clones"
30
+ fi
31
+
32
+
33
+ PROJECT_DIR=`git rev-parse --show-toplevel 2>/dev/null`
34
+ if [ ! "$PROJECT_DIR" ]; then
35
+ echo "Run 'git dropbox' in a git repository to mirror it to $FOLDER/[repo-name].git/"
36
+ exit
37
+ fi
38
+
39
+ DROPBOX_REPO=`git config --local dropbox.repo 2>/dev/null`
40
+ if [ ! "$DROPBOX_REPO" ]; then
41
+ PROJECT_NAME=`basename "$PROJECT_DIR"`
42
+ DROPBOX_REPO="$FOLDER/$PROJECT_NAME.git"
43
+ fi
44
+
45
+ if [ ! -d "$DROPBOX_REPO" ]; then
46
+ mkdir -p $DROPBOX_REPO
47
+ (cd $DROPBOX_REPO; git init --bare)
48
+ fi
49
+
50
+ if [ ! -d "$DROPBOX_REPO" ]; then
51
+ echo "Could not create $DROPBOX_REPO. Check that you have permissions to create it."
52
+ exit 1
53
+ fi
54
+
55
+ git push "$DROPBOX_REPO" --mirror
@@ -0,0 +1,6 @@
1
+ module Git
2
+ module Dropbox
3
+ # git-dropbox version
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'git/dropbox'
3
+
4
+ describe Git::Dropbox do
5
+ it "should have a VERSION constant" do
6
+ subject.const_get('VERSION').should_not be_empty
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'rspec'
2
+ require 'git/dropbox/version'
3
+
4
+ include Git::Dropbox
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git-dropbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Lukasz Kaniowski
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-02 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: &2157039780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.15.4
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2157039780
25
+ - !ruby/object:Gem::Dependency
26
+ name: bundler
27
+ requirement: &2157036680 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *2157036680
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &2157034060 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '0.8'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2157034060
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &2157032700 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.4'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *2157032700
58
+ - !ruby/object:Gem::Dependency
59
+ name: rubygems-tasks
60
+ requirement: &2157020500 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: '0.2'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *2157020500
69
+ description: Gem mirrors your git repositorys in dropbox folder
70
+ email: lukasz.kaniowski@gmail.com
71
+ executables:
72
+ - git-dropbox
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - ChangeLog.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/git-dropbox
84
+ - git-dropbox.gemspec
85
+ - lib/git/dropbox.rb
86
+ - lib/git/dropbox/cli.rb
87
+ - lib/git/dropbox/git-dropbox-org.sh
88
+ - lib/git/dropbox/version.rb
89
+ - spec/dropbox_spec.rb
90
+ - spec/spec_helper.rb
91
+ homepage: https://github.com/lukasz-kaniowski/git-dropbox#readme
92
+ licenses:
93
+ - MIT
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ segments:
105
+ - 0
106
+ hash: 3520450908102992967
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 1.8.10
116
+ signing_key:
117
+ specification_version: 3
118
+ summary: mirrors git into dropbox
119
+ test_files:
120
+ - spec/dropbox_spec.rb
121
+ - spec/spec_helper.rb