falkorlib 0.1.0 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07d829cbcd3226f0aaffc657d372f9d79c7f380f
4
- data.tar.gz: c7f91a6b8511be9aa191b57c7642235e51e00cc4
3
+ metadata.gz: 2b4d902ef27725191ab3ba66d8f69d3517910b80
4
+ data.tar.gz: 9c9aa7810bbab86718bea1388dab130ee7271ddf
5
5
  SHA512:
6
- metadata.gz: 6fd0c8ebfeec617c3dc92067abde181dfb749961ee5d97e20e60bbc61e020287c136a9a0f65a05e708914616af500b6b34d04352a0429f572cd170fe8643f328
7
- data.tar.gz: 8669e8dfc829ecc020ccb9d65a4b8a65c62bf7bf9668883e70156d34bab9d8fd5f89ecf540ef6923966c96c1027ac8bae42432945a44a538783486c5ca53a22a
6
+ metadata.gz: 207f58fd964609f15bbdaf1cc6c01bb257a4c24ba9d3a64363795505a5d0d6d9baddcdc9683e662f262b26346d42e76601de0d4d24a62723948e78f23d522f69
7
+ data.tar.gz: efae0b5b5367f13cf32f5dc237be05bab0a359e38299758cba64ab87bc8d2899d953a8366499e6731036a11f672211e35dcac2aea198878c4bf4ec14fad0d90d
data/Gemfile.lock CHANGED
@@ -1,25 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- falkorlib (0.1.0)
5
- git (~> 1.2, >= 1.2.5)
4
+ falkorlib (0.2.8)
5
+ awesome_print (~> 1.2)
6
+ configatron (~> 3.2)
6
7
  git_remote_branch (~> 0)
8
+ minigit (~> 0)
7
9
  rake (~> 10.1, >= 10.1.0)
8
10
  term-ansicolor (~> 1.3)
9
11
 
10
12
  GEM
11
13
  remote: http://rubygems.org/
12
14
  specs:
15
+ addressable (2.3.6)
13
16
  awesome_print (1.2.0)
17
+ backports (3.6.0)
14
18
  coderay (1.1.0)
19
+ configatron (3.2.0)
15
20
  diff-lcs (1.1.3)
16
- git (1.2.6)
21
+ ethon (0.7.0)
22
+ ffi (>= 1.3.0)
23
+ faraday (0.9.0)
24
+ multipart-post (>= 1.2, < 3)
25
+ faraday_middleware (0.9.1)
26
+ faraday (>= 0.7.4, < 0.10)
27
+ ffi (1.9.3)
28
+ gh (0.13.2)
29
+ addressable
30
+ backports
31
+ faraday (~> 0.8)
32
+ multi_json (~> 1.0)
33
+ net-http-persistent (>= 2.7)
34
+ net-http-pipeline
17
35
  git_remote_branch (0.3.8)
36
+ hashr (0.0.22)
37
+ highline (1.6.21)
38
+ json (1.8.1)
39
+ launchy (2.4.2)
40
+ addressable (~> 2.3)
18
41
  method_source (0.8.2)
42
+ minigit (0.0.4)
43
+ multi_json (1.10.1)
44
+ multipart-post (2.0.0)
45
+ net-http-persistent (2.9.4)
46
+ net-http-pipeline (1.0.1)
19
47
  pry (0.9.12.6)
20
48
  coderay (~> 1.0)
21
49
  method_source (~> 0.8)
22
50
  slop (~> 3.4)
51
+ pusher-client (0.6.0)
52
+ json
53
+ websocket (~> 1.0)
23
54
  rake (10.3.2)
24
55
  rspec (2.7.0)
25
56
  rspec-core (~> 2.7.0)
@@ -29,19 +60,40 @@ GEM
29
60
  rspec-expectations (2.7.0)
30
61
  diff-lcs (~> 1.1.2)
31
62
  rspec-mocks (2.7.0)
63
+ rubygems-tasks (0.2.4)
64
+ safe_yaml (0.9.7)
32
65
  slop (3.5.0)
33
66
  term-ansicolor (1.3.0)
34
67
  tins (~> 1.0)
35
68
  tins (1.3.0)
69
+ travis (1.6.11)
70
+ addressable (~> 2.3)
71
+ backports
72
+ faraday (~> 0.9)
73
+ faraday_middleware (~> 0.9)
74
+ gh (~> 0.13)
75
+ highline (~> 1.6)
76
+ launchy (~> 2.1)
77
+ pry (~> 0.9)
78
+ pusher-client (~> 0.4)
79
+ typhoeus (~> 0.6, >= 0.6.8)
80
+ travis-lint (1.8.0)
81
+ hashr (~> 0.0.22)
82
+ safe_yaml (~> 0.9.0)
83
+ typhoeus (0.6.8)
84
+ ethon (>= 0.7.0)
85
+ websocket (1.1.4)
36
86
  yard (0.8.7.4)
37
87
 
38
88
  PLATFORMS
39
89
  ruby
40
90
 
41
91
  DEPENDENCIES
42
- awesome_print (~> 1.2)
43
92
  bundler (~> 1.0)
44
93
  falkorlib!
45
94
  pry (~> 0.9)
46
95
  rspec (~> 2.7, >= 2.7.0)
96
+ rubygems-tasks (~> 0.2)
97
+ travis (~> 1.6)
98
+ travis-lint (~> 1.8)
47
99
  yard (~> 0.8)
data/README.md CHANGED
@@ -1,31 +1,129 @@
1
1
  -*- mode: markdown; mode: auto-fill; fill-column: 80 -*-
2
2
 
3
- Time-stamp: <Thu 2012-09-27 16:24 svarrette>
3
+ Time-stamp: <Ven 2014-06-06 16:59 svarrette>
4
+ _____ _ _ _ _ _
5
+ | ___|_ _| | | _____ _ __| | (_) |__
6
+ | |_ / _` | | |/ / _ \| '__| | | | '_ \
7
+ | _| (_| | | < (_) | | | |___| | |_) |
8
+ |_| \__,_|_|_|\_\___/|_| |_____|_|_.__/
4
9
 
5
- -------------------------------------------
6
- * File: `README.md`
7
- * Author: Sebastien Varrette (<mailto:Sebastien.Varrette@uni.lu>)
8
- * Copyright: Copyright (c) 2012 [Sebastien Varrette](mailto:<Sebastien.Varrette@uni.lu>) [www](http://varrette.gforge.uni.lu)
9
- * License: MIT -- see `LICENCE.md`
10
+
11
+ Copyright (c) 2012-2014 Sebastien Varrette <Sebastien.Varrette@uni.lu>
12
+ https://github.com/Falkor/falkorlib
10
13
 
11
- -------------------
12
14
 
13
15
  # FalkorLib
14
16
 
17
+ [![Build Status](https://travis-ci.org/Falkor/falkorlib.png)](https://travis-ci.org/Falkor/falkorlib)
18
+
15
19
  Sebastien Varrette aka Falkor's Common library to share Ruby code and `{rake,cap}`
16
20
  tasks.
17
21
 
22
+ * [Official Gem site](https://rubygems.org/gems/falkorlib)
23
+ * [GitHub](https://github.com/Falkor/falkorlib)
24
+
18
25
  ## Installation
19
26
 
20
- ## Pre-requisite
27
+ You'll typically want to install FalkorLib using [Bundler](http://bundler.io/).
28
+ To do this, simply add this line to your application's `Gemfile`:
29
+
30
+ gem 'falkorlib'
31
+
32
+ And then execute:
33
+
34
+ $> bundle
35
+
36
+ Or install it yourself as:
37
+
38
+ $> gem install falkorlib
39
+
40
+ **Note** you probably wants to do the above within an isolated environment. See below for some explanation on this setup.
41
+
42
+ ## Usage
43
+
44
+ This library features two aspect
45
+
46
+ * A set of toolbox functions / components I'm using everywhere in my Ruby developments, more specifically a set of modules:
47
+ * `FalkorLib::Common`: Recipe for all my toolbox and versatile Ruby functions I'm using everywhere.
48
+ You'll typically want to include the `FalkorLib::Common` module to bring the corresponding definitions into your scope. Example:
49
+
50
+ require 'falkorlib'
51
+ include FalkorLib::Common
52
+
53
+ info 'exemple of information text'
54
+ really_continue?
55
+ run %{ echo 'this is an executed command' }
56
+
57
+ Falkor.config.debug = true
58
+ run %{ echo 'this is a simulated command that *will not* be executed' }
59
+ error "that's an error text, let's exit with status code 1"all my toolbox printing functions I'm using everywhere
60
+
61
+
62
+ * `FalkorLib::Config`: all configuration aspects, implemented using [configatron](https://github.com/Falkor/falkorlib). `FalkorLib.config` canbe used to customized the defaults settings, for instance by;
63
+
64
+ FalkorLib.config do |c|
65
+ c.debug = true
66
+ end
67
+
68
+
69
+ * `FalkorLib::Git`: all git operations
70
+ * `FalkorLib::Version`: versioning management
71
+
72
+ * Some [rake](https://github.com/jimweirich/rake) tasks to facilitate common operations.
73
+ In general you can simply embedded my tasks by adding the following header in your `Rakefile`:
74
+
75
+ # In Rakefile
76
+ require "falkorlib/<object>_tasks"
77
+
78
+ or
79
+
80
+ #In Rakefile
81
+ require "falkorlib/tasks/<object>"
82
+
83
+ ### `FalkorLib` Ruby Modules / Classes Documentation
84
+
85
+ [Online documentation](https://rubygems.org/gems/falkorlib) is a available.
86
+ Yet to get the latest version, you might want to run
87
+
88
+ $> rake yard:doc
89
+
90
+ This will generate the documentation in `doc/api/` folder.
91
+
92
+ Statistics on the documentation generation (in particular *non*-documented components) can be obtained by
93
+
94
+ $> rake yard:stats
95
+
96
+
97
+ ### Overview of the implemented Rake tasks
98
+
99
+ You can find the list of implemented Rake tasks (detailed below) in the `lib/falkorlib/*_tasks.rb` files
100
+
101
+ For a given task object `<obj>` (*git* tasks for instance as proposed in `lib/falkorlib/git_tasks.rb`), you can specialize the corresponding configuration by using the block construction of `FalkorLib.config do |c| ... end` **before** requiring the task file:
102
+
103
+ # In Rakefile
104
+ require 'falkorlib'
105
+
106
+ # Configuration for the 'toto' tasks
107
+ FalkorLib.config.toto do |c|
108
+ toto.foo = bar # see `rake falkorlib:conf` to print the current configuration of FalkorLib
109
+ end
110
+
111
+ require "falkorlib/tasks/toto" # OR require "falkorlib/toto_tasks"
112
+
113
+
114
+ ## Proposed Rake tasks
21
115
 
22
- The Git branching model for this repository follows the guidelines of
23
- [gitflow](http://nvie.com/posts/a-successful-git-branching-model/) and is
24
- detailed below. Therefore, you should have `git-flow` installed on your machine
25
- following the
26
- [git-flow installation guide](https://github.com/nvie/gitflow/wiki/Installation).
27
116
 
28
- ### Building the gem from the source
117
+ * **Gem Management**: see `lib/falkorlib/tasks/gem.rake`
118
+ * **Git Management**
119
+ * ... TODO: complete list
120
+
121
+
122
+ ## Implementation details
123
+
124
+ If you want to contribute to the code, you shall be aware of the way I organize this gem and implementation details.
125
+
126
+ ### [RVM](https://rvm.io/) setup
29
127
 
30
128
  Get the source of this library by cloning the repository as follows:
31
129
 
@@ -49,41 +147,55 @@ Then install the required dependent gems as follows:
49
147
 
50
148
  $> bundle install
51
149
 
52
- ### Gem installation
53
150
 
54
- Add this line to your application's Gemfile:
151
+ ### Git Branching Model
55
152
 
56
- gem 'falkorlib'
153
+ The Git branching model for this repository follows the guidelines of [gitflow](http://nvie.com/posts/a-successful-git-branching-model/).
154
+ In particular, the central repository holds two main branches with an infinite lifetime:
57
155
 
58
- And then execute:
156
+ * `production`: the branch holding tags of the successive releases of this tutorial
157
+ * `devel`: the main branch where the sources are in a state with the latest delivered development changes for the next release. This is the *default* branch you get when you clone the repo, and the one on which developments will take places.
59
158
 
60
- $ bundle
159
+ You should therefore install [git-flow](https://github.com/nvie/gitflow), and probably also its associated [bash completion](https://github.com/bobthecow/git-flow-completion).
160
+ Also, to facilitate the tracking of remote branches, you probably wants to install [grb](https://github.com/webmat/git_remote_branch) (typically via ruby gems).
61
161
 
62
- Or install it yourself as:
162
+ Then, to make your local copy of the repository ready to use my git-flow workflow, you have to run the following commands once you cloned it for the first time:
63
163
 
64
- $ gem install falkorlib
164
+ $> rake setup # Not yet implemented!
65
165
 
66
- ## Usage
166
+ ### Working in a separate project
67
167
 
68
- TODO: Write usage instructions here
168
+ To illustrate the usage of the library as a regular user would do, you are advised to dedicate a directory for your tests. Here is for instance the layout of my testing directory:
69
169
 
170
+ $> cd FalkorLibTests
171
+ $> tree .
172
+ .
173
+ ├── Gemfile
174
+ ├── Gemfile.lock
175
+ ├── Rakefile
176
+ └── test
177
+ └── tester.rb # in a subdirectory on purpose
70
178
 
71
- ## Git Branching Model
179
+ $> cat cat Gemfile
180
+ source "https://rubygems.org"
181
+ gem 'falkorlib', :path => '~/git/github.com/Falkor/falkorlib' # or whichever path that works for you
72
182
 
73
- The Git branching model for this repository follows the guidelines of [gitflow](http://nvie.com/posts/a-successful-git-branching-model/).
74
- In particular, the central repository holds two main branches with an infinite lifetime:
183
+ Adapt the `Rakefile` and `tester.rb` file to reflect your tests.
75
184
 
76
- * `production`: the branch holding tags of the successive releases of this tutorial
77
- * `devel`: the main branch where the sources are in a state with the latest delivered development changes for the next release. This is the *default* branch you get when you clone the repo, and the one on which developments will take places.
78
185
 
79
- You should therefore install [git-flow](https://github.com/nvie/gitflow), and probably also its associated [bash completion](https://github.com/bobthecow/git-flow-completion).
80
- Also, to facilitate the tracking of remote branches, you probably wants to install [grb](https://github.com/webmat/git_remote_branch) (typically via ruby gems).
186
+ ### RSpec tests
81
187
 
82
- Then, to make your local copy of the repository ready to use my git-flow workflow, you have to run the following commands once you cloned it for the first time:
188
+ I try to define a set of unitary tests to validate the different function of my library using [Rspec](http://rspec.info/)
83
189
 
84
- $> rake setup # Not yet implemented!
190
+ You can run these tests by issuing:
191
+
192
+ $> rake rspec
193
+
194
+ By conventions, you will find all the currently implemented tests in the `spec/` directory, in files having the `_spec.rb` suffix. This is expected from the `rspec` task of the Rakefile (see `lib/falkorlib/tasks/rspec.rake`) for details.
195
+
196
+
197
+ **Important** Kindly stick to this convention, and feature tests for all definitions/classes/modules you might want to add to `FalkorLib`.
85
198
 
86
- Note that it assumes you have installed `grb`
87
199
 
88
200
  ## Contributing
89
201
 
@@ -115,4 +227,5 @@ You should become familiar (if not yet) with Git. Consider these resources:
115
227
 
116
228
  ### Links
117
229
 
118
- https://github.com/Falkor/falkorlib
230
+ * [Official Gem site](https://rubygems.org/gems/falkorlib)
231
+ * [GitHub](https://github.com/Falkor/falkorlib)
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  ##############################################################################
2
2
  # Rakefile - Configuration file for rake (http://rake.rubyforge.org/)
3
- # Time-stamp: <Lun 2014-06-02 14:58 svarrette>
3
+ # Time-stamp: <Jeu 2014-06-19 18:51 svarrette>
4
4
  #
5
5
  # Copyright (c) 2012 Sebastien Varrette <Sebastien.Varrette@uni.lu>
6
6
  # . http://varrette.gforge.uni.lu
@@ -15,31 +15,50 @@
15
15
  # Resources:
16
16
  # * http://www.stuartellis.eu/articles/rake/
17
17
  ##############################################################################
18
- require "bundler/gem_tasks"
19
18
 
19
+ task :default => [ :build, :rspec ]
20
+ #.....................
21
+ require 'rake/clean'
20
22
 
21
- # We run tests by default
22
- task :default => :test
23
+ CLEAN.add 'pkg'
24
+ CLOBBER.add 'doc'
23
25
 
24
- #
25
- # Install all tasks found in tasks folder
26
- #
27
- # See .rake files there for complete documentation.
28
- #
29
- RAKE_TASKS_TO_LOAD = [
30
- #'debug_mail.rake',
31
- 'gem.rake',
32
- 'spec_test.rake',
33
- #'unit_test.rake',
34
- 'yard.rake'
35
- ]
36
-
37
- Dir["tasks/*.rake"].each do |taskfile|
38
- next unless RAKE_TASKS_TO_LOAD.include?(taskfile.gsub(/.*tasks\//, ''))
39
- load taskfile
26
+ #.....................
27
+ #namespace :gem do
28
+ require 'rubygems/tasks'
29
+ Gem::Tasks.new do |tasks|
30
+ tasks.console.command = 'pry'
31
+ tasks.sign.checksum = true
32
+ tasks.sign.pgp = true
33
+ end
34
+ #end # namespace gem
35
+
36
+ #__________________ My own rake tasks __________________
37
+ lib = File.expand_path('../lib', __FILE__)
38
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
39
+
40
+ require "falkorlib"
41
+
42
+ # Adapt the versioning aspects
43
+ FalkorLib.config.versioning do |c|
44
+ c[:type] = 'gem'
45
+ end
46
+
47
+ # Adapt the Git flow aspects
48
+ FalkorLib.config.gitflow do |c|
49
+ c[:branches] = {
50
+ :master => 'production',
51
+ :develop => 'devel'
52
+ }
40
53
  end
41
54
 
42
- desc "clean the directory"
43
- task :clean => :clobber_package do
44
- sh "rm -rf doc" if File.directory?("doc")
55
+
56
+
57
+ [ 'rspec', 'yard', 'git', 'gitflow' ] .each do |tasks|
58
+ load "falkorlib/tasks/#{tasks}.rake"
45
59
  end
60
+
61
+ # desc "clean the directory"
62
+ # task :clean => :clobber_package do
63
+ # sh "rm -rf doc" if File.directory?("doc")
64
+ # end
data/falkorlib.gemspec CHANGED
@@ -94,9 +94,6 @@ Gem::Specification.new do |s|
94
94
  #s.files = `git ls-files`.split("\n")
95
95
  #s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
96
96
  #s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
97
-
98
-
99
-
100
97
 
101
98
  # The path in the gem for executable scripts (optional)
102
99
  #
@@ -128,9 +125,12 @@ Gem::Specification.new do |s|
128
125
  #s.add_dependency("rake", ">= 10.1.0")
129
126
  s.add_runtime_dependency 'rake', '~> 10.1', '>= 10.1.0'
130
127
  s.add_runtime_dependency 'git_remote_branch', '~> 0'
131
- #s.add_dependency("git_remote_branch")
132
- s.add_runtime_dependency 'git', '~> 1.2', '>= 1.2.5'
133
- s.add_dependency("term-ansicolor", "~> 1.3")
128
+ #s.add_runtime_dependency 'git', '~> 1.2', '>= 1.2.5'
129
+ s.add_runtime_dependency('minigit', '~> 0')
130
+ s.add_runtime_dependency("term-ansicolor", "~> 1.3")
131
+ s.add_runtime_dependency("configatron", "~> 3.2")
132
+ s.add_runtime_dependency("awesome_print", "~> 1.2")
133
+
134
134
 
135
135
  #
136
136
  # One call to add_dependency('gem_name', 'gem version requirement') for each
@@ -143,7 +143,11 @@ Gem::Specification.new do |s|
143
143
  s.add_development_dependency 'rspec', '~> 2.7', '>= 2.7.0'
144
144
  s.add_development_dependency("pry", "~> 0.9")
145
145
  s.add_development_dependency("yard", "~> 0.8")
146
- s.add_development_dependency("awesome_print", "~> 1.2")
146
+ #s.add_development_dependency("minitest", "~> 5.3")
147
+ s.add_development_dependency("rubygems-tasks", "~> 0.2")
148
+ s.add_development_dependency("travis", "~> 1.6")
149
+ s.add_development_dependency("travis-lint", "~> 1.8")
150
+
147
151
  #s.add_development_dependency("bluecloth", "~> 2.2.0")
148
152
  #s.add_development_dependency("wlang", "~> 0.10.2")
149
153