Skip to content

Commit

Permalink
add gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
siuying committed May 31, 2012
1 parent bf6e58d commit 10ff787
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 473 deletions.
48 changes: 48 additions & 0 deletions README.md
@@ -0,0 +1,48 @@
# motion-logger

A thin wrapper of CocoaLumberjack for RubyMotion.

Status: Basic features working

## Usage

```ruby
file_logger = DDFileLogger.new
file_logger.rollingFrequency = 60 * 60 * 24
file_logger.logFileManager.maximumNumberOfLogFiles = 1
Log.addLogger file_logger

tty_logger = DDTTYLogger.sharedInstance
Log.addLogger tty_logger

Log.level = :warn

Log.info "Hello World"
Log.warn "WARNING!"
Log.debug "Lah"
Log.flush
```

## Setup

Install the gem:

```
gem install motion-logger
```

Require the gem in Rakefile:

```
require 'rubygems'
require 'motion-logger'
Motion::Project::App.setup do |app|
app.name = 'MyApp'
# Only needed if you are not already using pods
app.pods do
dependency 'CocoaLumberjack'
end
end
```
5 changes: 5 additions & 0 deletions lib/logger/version.rb
@@ -0,0 +1,5 @@
module Motion
module Logger
VERSION = "0.1.0"
end
end
7 changes: 4 additions & 3 deletions lib/motion-logger.rb
Expand Up @@ -2,12 +2,13 @@
raise "This file must be required within a RubyMotion project Rakefile."
end

require 'motion-cocoapods'

Motion::Project::App.setup do |app|
Dir.glob(File.join(File.dirname(__FILE__), 'logger/*.rb')).each do |file|
app.files.unshift file
end

app.pods do
dependency 'CocoaLumberjack'
end
app.pods ||= Motion::Project::CocoaPods.new(app)
app.pods.dependency 'CocoaLumberjack'
end
16 changes: 16 additions & 0 deletions motion-logger.gemspec
@@ -0,0 +1,16 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/bubble-wrap/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ["Francis Chong"]
gem.email = ["francis@ignition.hk"]
gem.description = "A thin wrapper of CocoaLumberjack for RubyMotion."
gem.summary = "A thin wrapper of CocoaLumberjack for RubyMotion."
gem.homepage = "https://github.com/siuying/motion-logger"

gem.files = `git ls-files`.split($\)
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "motion-logger"
gem.require_paths = ["lib"]
gem.version = BubbleWrap::VERSION
end
4 changes: 2 additions & 2 deletions spec/log_spec.rb
Expand Up @@ -2,10 +2,10 @@
Log = Motion::Log

before do
@file_logger = DDFileLogger.alloc.init
@file_logger = DDFileLogger.new
@file_logger.rollingFrequency = 60 * 60 * 24
@file_logger.logFileManager.maximumNumberOfLogFiles = 1
Log.addLogger(@file_logger)
Log.addLogger @file_logger
end

after do
Expand Down

0 comments on commit 10ff787

Please sign in to comment.