Skip to content

Commit

Permalink
prepare for github
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltFabok committed Jul 15, 2014
1 parent 8282003 commit 953c78e
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: ruby
rvm:
- 2.1.1
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ gemspec
group :development do
gem 'debugger', '~> 1.6.8'
end

gem 'coveralls', :require => false
29 changes: 29 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
New BSD License (3-clause license)

Copyright (c) 2013-2014, Zsolt Fabok
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of Zsolt Fabok nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Leankit Download
[![Build Status](https://travis-ci.org/ZsoltFabok/leankit_download.png)](https://travis-ci.org/ZsoltFabok/leankit_download)
[![Dependency Status](https://gemnasium.com/ZsoltFabok/leankit_download.png)](https://gemnasium.com/ZsoltFabok/leankit_download)
[![Code Climate](https://codeclimate.com/github/ZsoltFabok/leankit_download.png)](https://codeclimate.com/github/ZsoltFabok/leankit_download)
[![Coverage Status](https://coveralls.io/repos/ZsoltFabok/leankit_download/badge.png?branch=master)](https://coveralls.io/r/ZsoltFabok/leankit_download?branch=master)

Downloads card history data from Leankit.

#### Install
gem install leankit_download

#### Usage

First you will need a `boards.json` file that contains the authentication credentials and list of boards which cards you want to download:

{
"leankit" : {
"email": "<email>",
"password": "<password>",
"account": "<account>"
},
"boards": {
"<case sensitive board name>" : {
}
}
}

For command line:

leankit_download [--dry-run] <boards.json location> <destination>

Using `--dry-run` will tell the application not to connect to *leankit*.

For ruby code:

requre 'leankit_download'

download_board = LeankitDownload::DownloadBoard.create
download_locations = download_board.download(
"./boards.json", "./leankit_dump")

The `download_board.download` returns the paths to the individual boards with card histories.

### Copyright

Copyright (c) 2014 Zsolt Fabok and Contributors. See [LICENSE](LICENSE.md) for details.
6 changes: 3 additions & 3 deletions leankit_download.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require 'leankit_download/version'
Gem::Specification.new do |s|
s.name = 'leankit_download'
s.version = LeankitDownload::VERSION
s.date = '2014-01-15'
s.date = '2014-07-15'
s.summary = "leankit_download-#{s.version}"
s.description = "downloads data from leankit"
s.description = "Downloads card history data from leankit"
s.authors = ["Zsolt Fabok"]
s.email = 'me@zsoltfabok.com'
s.homepage = ''
s.homepage = 'https://github.com/ZsoltFabok/leankit_download'
s.license = 'BSD'

s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ || path =~ /file$/ }
Expand Down
4 changes: 4 additions & 0 deletions lib/leankit_download/download_board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ def initialize(files_and_json)
@files_and_json = files_and_json
end

##
# Downloads the history of cards provided in the json configuration file and returns
# the paths to the location where they are stored.
def download(boards_json, destination, dry_run=false)
content = @files_and_json.from_file(boards_json)
email = content["leankit"]["email"]
Expand Down Expand Up @@ -73,6 +76,7 @@ def get_board_id(destination, board_name)
return nil
end

private
def get_card_ids(board_id)
board = LeanKitKanban::Board.find(board_id)[0]
archive = LeanKitKanban::Archive.fetch(board_id)[0][0]
Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
require 'rspec'
require 'coveralls'
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
add_filter '/spec/'
end

begin
require "debugger"
Expand Down

0 comments on commit 953c78e

Please sign in to comment.