otacrawler 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/database.yml +11 -12
- data/lib/otacrawler.rb +2 -1
- data/lib/otacrawler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c770877fc688a529a290b30e689582ddf248a0b
|
4
|
+
data.tar.gz: b50c9bb7a5a29dc0ecf0f3b6c7df453150c675da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a6b90ba6e64a7ef72e632647fb199bdc06b76cc979d907fc281d3f0101652491a432d6efd709fed0cf5683f32780e860678b382b7c90e15bb399c8658e0162b
|
7
|
+
data.tar.gz: de0bccb6b008d0aa69c7bc8baa348e818735a12f51c52335fc63fbe80edcd46c715b81f6356957f80ccd27378c04b5499c6e1d1219ea8c29fc14fc50492f0dac
|
data/README.md
CHANGED
@@ -21,6 +21,22 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
+
Setting database:
|
25
|
+
```YAML
|
26
|
+
# database.yml
|
27
|
+
development:
|
28
|
+
adapter: mysql2
|
29
|
+
host: localhost
|
30
|
+
username: root
|
31
|
+
database: otacrawler
|
32
|
+
|
33
|
+
production:
|
34
|
+
adapter: mysql2
|
35
|
+
host: xxxx
|
36
|
+
username: xxxx
|
37
|
+
database: otacrawler
|
38
|
+
```
|
39
|
+
|
24
40
|
Run robot:
|
25
41
|
|
26
42
|
```ruby
|
@@ -31,7 +47,8 @@ Run robot:
|
|
31
47
|
## ENV
|
32
48
|
|
33
49
|
```
|
34
|
-
DATABASE_SETTING_PATH - Database setting file path.
|
50
|
+
DATABASE_SETTING_PATH - Database setting file path. That file formatted YAML.
|
51
|
+
OTACRAWLER_ENV - Setting environment. This doesn't overrides the value of the environment variable RAILS_ENV.
|
35
52
|
```
|
36
53
|
|
37
54
|
## Development
|
data/database.yml
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
database: xxxxxxxx
|
1
|
+
production:
|
2
|
+
adapter: mysql2
|
3
|
+
host: localhost
|
4
|
+
username: xxxxxxxx
|
5
|
+
password: xxxxxxxx
|
6
|
+
database: xxxxxxxx
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
development:
|
9
|
+
adapter: mysql2
|
10
|
+
host: localhost
|
11
|
+
username: root
|
12
|
+
database: otacrawler
|
data/lib/otacrawler.rb
CHANGED
@@ -5,7 +5,8 @@ require "active_record"
|
|
5
5
|
|
6
6
|
module Otacrawler
|
7
7
|
config = YAML.load(ERB.new(IO.read(ENV["DATABASE_SETTING_PATH"])).result)
|
8
|
-
|
8
|
+
env = ENV["RAILS_ENV"] || ENV["OTACRAWLER_ENV"]
|
9
|
+
ActiveRecord::Base.establish_connection(config[env])
|
9
10
|
|
10
11
|
class << self
|
11
12
|
include Mem
|
data/lib/otacrawler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: otacrawler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yuta-muramoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mem
|