tdiary-io-mongodb 4.2.0 → 5.0.3
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 +4 -4
- data/.travis.yml +11 -3
- data/Gemfile +1 -0
- data/README.md +40 -5
- data/lib/tdiary/io/mongodb.rb +3 -1
- data/spec/spec_helper.rb +1 -1
- data/tdiary-io-mongodb.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9d87a14e421d3e501b09a8b5e8ef446fbb7386e
|
|
4
|
+
data.tar.gz: 04cfd294fae76cce64f64b16dca43b415ad3f703
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bbbbac2194fad9e42866b3539e44593f47af05e28e694701a9237145b8bfde727676dbe06d9eeeee62ba84ded3d0b6eb4104f9b1926e155015dac7e68632edc3
|
|
7
|
+
data.tar.gz: '0578140605a1ebf9fd920af00085071916e8eafb74a1230fb8eded238e3da73ab3b343c0059222d9a4599260e2d40ba82db38f9c6ceb2b406974e5cadcab86dc'
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ mongoid adapter for tDiary
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
Add this line to your
|
|
7
|
+
Add this line to your tDiary's Gemfile.local:
|
|
8
8
|
|
|
9
9
|
gem 'tdiary-io-mongodb'
|
|
10
10
|
|
|
@@ -12,10 +12,6 @@ And then execute:
|
|
|
12
12
|
|
|
13
13
|
$ bundle
|
|
14
14
|
|
|
15
|
-
Or install it yourself as:
|
|
16
|
-
|
|
17
|
-
$ gem install tdiary-io-mongodb
|
|
18
|
-
|
|
19
15
|
## Usage
|
|
20
16
|
|
|
21
17
|
Add follow snipet to your tdiary.conf
|
|
@@ -24,6 +20,45 @@ Add follow snipet to your tdiary.conf
|
|
|
24
20
|
@io_class = TDiary::IO::MongoDB
|
|
25
21
|
```
|
|
26
22
|
|
|
23
|
+
## Migration
|
|
24
|
+
|
|
25
|
+
`bin/tdiary-mongodb-convert` is utility that uploads tDiary default IO data to MongoDB.
|
|
26
|
+
|
|
27
|
+
(1) Migrate tDiary configuration
|
|
28
|
+
|
|
29
|
+
Migrate your tDiary configuration to MongoDB.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
$ bundle exec tdiary-mongodb-convert -c $DATA_PATH/tdiary.conf -m $MONGODB_URI
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
* $MONGODB_URI: the uri of mongodb (mongodb://)
|
|
36
|
+
* $DATA_PATH: the path of your tdiary data directory
|
|
37
|
+
|
|
38
|
+
(2) Migrate tDiary data
|
|
39
|
+
|
|
40
|
+
Migrate your tDiary data to MongoDB.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
$ bundle exec tdiary-mongodb-convert -s ./lib/tdiary/style -m $MONGODB_URI $DATA_PATH
|
|
44
|
+
```
|
|
45
|
+
* $MONGODB_URI: the uri of mongodb (mongodb://)
|
|
46
|
+
* $DATA_PATH: the path of your tdiary data directory
|
|
47
|
+
|
|
48
|
+
### Note
|
|
49
|
+
|
|
50
|
+
If you use the style provided by an external gem (like GFM style), append the gem to Gemfile and run `bundle`.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
gem 'tdiary-style-gfm'
|
|
54
|
+
gem 'tdiary-style-etdiary'
|
|
55
|
+
gem 'tdiary-style-rd
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### See also
|
|
59
|
+
|
|
60
|
+
* http://sho.tdiary.net/20150206.html#p01 (in Japanese)
|
|
61
|
+
|
|
27
62
|
## Contributing
|
|
28
63
|
|
|
29
64
|
1. Fork it
|
data/lib/tdiary/io/mongodb.rb
CHANGED
|
@@ -110,6 +110,8 @@ module TDiary
|
|
|
110
110
|
include Cache
|
|
111
111
|
|
|
112
112
|
class << self
|
|
113
|
+
Mongo::Logger.level = Logger::WARN
|
|
114
|
+
|
|
113
115
|
def load_cgi_conf(conf)
|
|
114
116
|
db(conf)
|
|
115
117
|
if cgi_conf = Conf.all.first
|
|
@@ -131,7 +133,7 @@ module TDiary
|
|
|
131
133
|
|
|
132
134
|
def db(conf)
|
|
133
135
|
@@_db ||= Mongoid::Config.load_configuration(
|
|
134
|
-
{
|
|
136
|
+
{clients:{default:{uri:(conf.database_url || 'mongodb://localhost:27017/tdiary')}}}
|
|
135
137
|
)
|
|
136
138
|
end
|
|
137
139
|
|
data/spec/spec_helper.rb
CHANGED
data/tdiary-io-mongodb.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "tdiary-io-mongodb"
|
|
7
|
-
spec.version = "
|
|
7
|
+
spec.version = "5.0.3"
|
|
8
8
|
spec.authors = ["TADA Tadashi"]
|
|
9
9
|
spec.email = ["t@tdtds.jp"]
|
|
10
10
|
spec.description = %q{MongoDB adapter for tDiary}
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.add_dependency "mongoid", "~>
|
|
20
|
+
spec.add_dependency "mongoid", "~> 6.0"
|
|
21
21
|
spec.add_dependency "hikidoc"
|
|
22
22
|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tdiary-io-mongodb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TADA Tadashi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mongoid
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '6.0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '6.0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: hikidoc
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
134
134
|
version: '0'
|
|
135
135
|
requirements: []
|
|
136
136
|
rubyforge_project:
|
|
137
|
-
rubygems_version: 2.
|
|
137
|
+
rubygems_version: 2.6.8
|
|
138
138
|
signing_key:
|
|
139
139
|
specification_version: 4
|
|
140
140
|
summary: MongoDB adapter for tDiary
|