tdiary-io-mongodb 4.2.0 → 5.0.3

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: 27237ff28a4c7aa4abcc18ba8c5632fa7e40cfdf
4
- data.tar.gz: 80c089e7233b40a66bf1a8ab0e75ec9ce7663c57
3
+ metadata.gz: e9d87a14e421d3e501b09a8b5e8ef446fbb7386e
4
+ data.tar.gz: 04cfd294fae76cce64f64b16dca43b415ad3f703
5
5
  SHA512:
6
- metadata.gz: d20555be2ad95905f77d8d7f3883e5aa27e80f8d9f5061bcc721613d6af11f09dcabe88571d366b30a355631affc1e24a7c54a3ff0d8aab3b201cbceedb8ec45
7
- data.tar.gz: c21327be947472cd5621e008ca60a365d431d74cd4ce430006b31f3d1a097129e1ca223b078ce02aec0d5c7dd622d0044782fd413d96be63f3b1242704ecfc2a
6
+ metadata.gz: bbbbac2194fad9e42866b3539e44593f47af05e28e694701a9237145b8bfde727676dbe06d9eeeee62ba84ded3d0b6eb4104f9b1926e155015dac7e68632edc3
7
+ data.tar.gz: '0578140605a1ebf9fd920af00085071916e8eafb74a1230fb8eded238e3da73ab3b343c0059222d9a4599260e2d40ba82db38f9c6ceb2b406974e5cadcab86dc'
data/.travis.yml CHANGED
@@ -1,8 +1,16 @@
1
1
  language: ruby
2
+ cache: bundler
3
+
2
4
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1
5
+ - 2.2
6
+ - 2.3.3
7
+ - 2.4.0
8
+ - ruby-head
9
+
10
+ before_install:
11
+ - gem update bundler
12
+
6
13
  script: bundle exec rake spec
14
+
7
15
  services:
8
16
  - mongodb
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'tdiary', github: 'tdiary/tdiary-core'
7
+ gem 'tdiary-style-rd'
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 application's Gemfile:
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
@@ -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
- {sessions:{default:{uri:(conf.database_url || 'mongodb://localhost:27017/tdiary')}}}
136
+ {clients:{default:{uri:(conf.database_url || 'mongodb://localhost:27017/tdiary')}}}
135
137
  )
136
138
  end
137
139
 
data/spec/spec_helper.rb CHANGED
@@ -83,7 +83,7 @@ end
83
83
 
84
84
  RSpec.configure do |c|
85
85
  c.after(:suite) do
86
- Mongoid.default_session.collections.each do |collection|
86
+ Mongoid.default_client.database.collections.each do |collection|
87
87
  collection.drop
88
88
  end
89
89
  end
@@ -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 = "4.2.0"
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", "~> 4.0"
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.2.0
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: 2015-09-30 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
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.4.5.1
137
+ rubygems_version: 2.6.8
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: MongoDB adapter for tDiary