simple-info 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c96eb14913703402f4230cfe2c9980448bfe5316
4
+ data.tar.gz: d3060419ad67c17d831e64f54cc959034d80c4af
5
+ SHA512:
6
+ metadata.gz: d5ccf92074e23f3a7a0bb7aa7a4c1be18b5e59b79b77970a38f46600de5c2cecf22c542bfc9d0e374ada3b7026d5ea102802ad889cc5937fb296085b3163fdeb
7
+ data.tar.gz: 1c4c98638930192b3ec801fd86caccf429995b76c31f82b61ee1ba80cd35e9e317f248898703cfbfef6ad59b0772c02341b714ad9f71f4d2de5904d50ffe99ec
data/.gitignore ADDED
@@ -0,0 +1,46 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ ## gem building
29
+ /.bundle/
30
+ /.yardoc
31
+ /Gemfile.lock
32
+ /_yardoc/
33
+ /coverage/
34
+ /doc/
35
+ /pkg/
36
+ /spec/reports/
37
+ /tmp/
38
+
39
+ # for a library or gem, you might want to ignore these files since the code is
40
+ # intended to run in multiple environments; otherwise, check them in:
41
+ # Gemfile.lock
42
+ # .ruby-version
43
+ # .ruby-gemset
44
+
45
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
46
+ .rvmrc
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ script:
2
+ - rspec
3
+ rvm:
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - ruby-head
8
+ notifications:
9
+ email:
10
+ on_success: always
11
+ on_failure: always
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gitReminders.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Jakub Niewczas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ SimpleInfo [![Build Status](https://travis-ci.org/kubenstein/simple-info.png?branch=master)](https://travis-ci.org/kubenstein/simple-info)
2
+ =============
3
+
4
+ Store, add or edit all kind of info in your git repositiory without polluting git history.
5
+
6
+ Use Cases
7
+ ---------
8
+
9
+ - Often I like to keep some info about infrastructure configuration of a project. Such as that project domain is registered in this company, emails are hosted here and web app in some other places.
10
+ - Often I store git commands setuping my personal username and email in git repository so In case of some quick fix I can commit as myself.
11
+
12
+ Instalation
13
+ ---------
14
+
15
+ ```
16
+ gem install simple-info
17
+ ```
18
+
19
+ Usage
20
+ ---------
21
+ To add or edit info:
22
+
23
+ ```
24
+ simple-info edit
25
+ # your fav text editor opens, so you can type your instructions
26
+ ```
27
+
28
+ To see stored info:
29
+
30
+ ```
31
+ simple-info
32
+ simple-info show
33
+ ```
34
+
35
+ To push info to remote:
36
+
37
+ ```
38
+ simple-info push origin
39
+ ```
40
+
41
+ To push info from remote:
42
+
43
+ ```
44
+ simple-info pull origin
45
+ ```
46
+
47
+ Internals
48
+ ---------
49
+ SimpleInfo uses annotated git tag. Special tag is created on top of first commit.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/simple-info ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'simple-info'
4
+
5
+ SimpleInfo::Cli.start(ARGV)
@@ -0,0 +1,3 @@
1
+ require 'simple-info/version'
2
+ require 'simple-info/cli'
3
+ require 'simple-info/tag'
@@ -0,0 +1,28 @@
1
+ require 'thor'
2
+
3
+ module SimpleInfo
4
+ class Cli < Thor
5
+ default_task :show
6
+
7
+ desc 'show', 'Show info'
8
+ def show
9
+ puts Tag.new.show
10
+ end
11
+
12
+ desc 'edit', 'Edit or add info.'
13
+ def edit
14
+ Tag.new.edit
15
+ end
16
+
17
+ desc 'pull', 'Pull info from remote, it will override current info.'
18
+ def pull(remote)
19
+ Tag.new.pull(remote)
20
+ end
21
+
22
+ desc 'push', 'Push info to remote.'
23
+ def push(remote)
24
+ Tag.new.push(remote)
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ module SimpleInfo
2
+ class Tag
3
+ TAG_NAME = 'simple_info_storage'
4
+
5
+ def edit
6
+ execute("git tag -f -a #{TAG_NAME} `git log --format=%H | tail -1`")
7
+ end
8
+
9
+ def show
10
+ return '' unless info_tag_exists?
11
+
12
+ execute("git cat-file tag #{TAG_NAME}").split("\n\n")[1].strip
13
+ end
14
+
15
+ def pull(remote)
16
+ execute("git fetch #{remote} tag #{TAG_NAME}")
17
+ end
18
+
19
+ def push(remote)
20
+ execute("git push --force #{remote} refs/tags/#{TAG_NAME}:refs/tags/#{TAG_NAME}")
21
+ end
22
+
23
+
24
+ private
25
+
26
+ def info_tag_exists?
27
+ execute("git tag").include? TAG_NAME
28
+ end
29
+
30
+ def execute(command)
31
+ command.include?('-a') ? Kernel.system(command) : `#{command}`
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module SimpleInfo
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'simple-info/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "simple-info"
9
+ spec.version = SimpleInfo::VERSION
10
+ spec.authors = ["Jakub Niewczas"]
11
+ spec.email = ["niewczas.jakub@gmail.com"]
12
+ spec.license = "MIT"
13
+
14
+ spec.summary = "Store any kind of info in your project git repo."
15
+ spec.description = "Store, add or edit all kind of info in your git repositiory without polluting git history."
16
+ spec.homepage = "https://github.com/kubenstein/simple-info"
17
+
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = "bin"
21
+ spec.executables = ["simple-info"]
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "thor", "~> 0.19"
25
+ spec.add_development_dependency "rspec", "~> 3"
26
+ spec.add_development_dependency "bundler", "~> 1"
27
+ spec.add_development_dependency "rake", "~> 10"
28
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simple-info
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jakub Niewczas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.19'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '10'
69
+ description: Store, add or edit all kind of info in your git repositiory without polluting
70
+ git history.
71
+ email:
72
+ - niewczas.jakub@gmail.com
73
+ executables:
74
+ - simple-info
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - .gitignore
79
+ - .travis.yml
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/simple-info
85
+ - lib/simple-info.rb
86
+ - lib/simple-info/cli.rb
87
+ - lib/simple-info/tag.rb
88
+ - lib/simple-info/version.rb
89
+ - simple-info.gemspec
90
+ homepage: https://github.com/kubenstein/simple-info
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.4.6
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: Store any kind of info in your project git repo.
114
+ test_files: []