diglossa 0.2.23 → 0.2.24

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,6 +35,26 @@ texts (paragraphs):
35
35
  dg pushtexts [PATH] # parse texts for root PATH, ex: dg docs "NT/Palama/Triads"
36
36
 
37
37
 
38
+ ## .couchapprc
39
+
40
+ Do not forget to generate .couchapprc file with <tt>dg gen your_appname</tt> and fill in your CouchDB credentials.
41
+
42
+ <tt> {
43
+ "env": {
44
+ "default": {
45
+ "db": "http://admin:password@localhost:5984/diglossa"
46
+ },
47
+ "production": {
48
+ "db": "http://admin:password@diglossa.ru:5984/diglossa"
49
+ }
50
+ },
51
+ "data": "~/web/diglossa.data",
52
+ "seeds": "~/web/socadimo/diglossa.blog",
53
+ "locales": ["ru", "en"]
54
+ }
55
+ </tt>
56
+
57
+
38
58
 
39
59
  ## ToDo
40
60
 
data/diglossa.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
26
26
 
27
27
  gem.add_runtime_dependency(%q<json>, ["~> 1.7.5"])
28
28
  gem.add_runtime_dependency(%q<mime-types>, ["~> 1.16"])
29
- gem.add_runtime_dependency(%q<typhoeus>, ["~> 0.6.3"])
29
+ #gem.add_runtime_dependency(%q<typhoeus>, ["~> 0.6.3"])
30
30
  gem.add_runtime_dependency(%q<rest-client>)
31
31
  gem.add_runtime_dependency(%q<thor>, ["~> 0.15"])
32
32
  #gem.add_runtime_dependency(%q<thor>, ["~> 0.15"])
data/lib/diglossa/cli.rb CHANGED
@@ -4,7 +4,7 @@ require 'thor/actions'
4
4
  require 'uuidtools'
5
5
  #require 'typhoeus'
6
6
  require 'rest_client'
7
- #require 'yaml'
7
+ require 'yaml'
8
8
  require 'pp'
9
9
  #require 'redcarpet'
10
10
 
@@ -24,16 +24,15 @@ module Diglossa
24
24
  doc
25
25
  end
26
26
 
27
-
28
27
  def build root, push=false
29
- # FIXME: Lib to .diglossarc
30
- fn = File.expand_path(File.join(Diglossa::Lib, root))
28
+ remote = Diglossa::Remote.new(app_dir)
29
+ data_dir = remote.config["data"]
30
+ #puts "locales #{remote.config["locales"]}"
31
+ fn = File.expand_path(File.join(data_dir, root))
31
32
  fullname = File.exist?("#{fn}.json") ? "#{fn}.json" : File.exist?("#{fn}.yml") ? "#{fn}.yml" : false
32
33
  return nil unless fullname
33
34
  doc = fullname ? YAML.load_file(fullname) : "no .json or .yml file at #{root}"
34
35
  @nics = doc["authors"]
35
- remote = Diglossa::Remote.new(app_dir)
36
- #puts "locales #{remote.config["locales"]}"
37
36
  @rpp = {}
38
37
  @dbauthors = remote.author(doc["authors"])
39
38
  @author_nic = root.split("/")[1].downcase
@@ -68,7 +67,8 @@ module Diglossa
68
67
 
69
68
  def parallels path, push = false
70
69
  remote = Diglossa::Remote.new(app_dir)
71
- dpath = File.expand_path(File.join(Diglossa::Lib, path))
70
+ data_dir = remote.config["data"]
71
+ dpath = File.expand_path(File.join(data_dir, path))
72
72
  return if File.directory?(dpath)
73
73
  @counter = []
74
74
  docs = []
@@ -9,8 +9,7 @@ module Diglossa
9
9
  self.app_dir = File.expand_path(app_dir) + '/'
10
10
  #self.config_path = config_path
11
11
  #load_config
12
- #load_couchapprc
13
- load_diglossarc
12
+ load_couchapprc
14
13
  end
15
14
 
16
15
  # def config_path=(config_path)
@@ -25,7 +24,7 @@ module Diglossa
25
24
  # end
26
25
  # end
27
26
 
28
- def load_diglossarc
27
+ def load_couchapprc
29
28
  # тут есть теперь "data-dir", но она нужна в parse, а не здесь. Как загружать один раз эту хрень?
30
29
  @config ||= {}
31
30
  @config = JSON.parse(File.read(File.join(app_dir, '.couchapprc')))
@@ -4,7 +4,9 @@
4
4
  "db": "http://admin:admin@localhost:5984/<%= appname %>"
5
5
  },
6
6
  "production": {
7
- "db": "http://admin:admin@localhost:5984/<%= appname %>"
7
+ "db": "http://admin:admin@diglossa.ru:5984/<%= appname %>"
8
8
  }
9
- }
9
+ },
10
+ "data": "~/web/diglossa.data",
11
+ "locales": ["ru", "en"]
10
12
  }
@@ -1,4 +1,3 @@
1
1
  module Diglossa
2
- VERSION = "0.2.23"
3
- Lib = "~/web/diglossa.data"
2
+ VERSION = "0.2.24"
4
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diglossa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.2.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-04 00:00:00.000000000 Z
12
+ date: 2013-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -107,22 +107,6 @@ dependencies:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
109
  version: '1.16'
110
- - !ruby/object:Gem::Dependency
111
- name: typhoeus
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
117
- version: 0.6.3
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: 0.6.3
126
110
  - !ruby/object:Gem::Dependency
127
111
  name: rest-client
128
112
  requirement: !ruby/object:Gem::Requirement