nucleon 0.2.12 → 0.2.13

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: 13c3e887c66f5bd85d72047d61e46bc174ca5a1f
4
- data.tar.gz: 0674201c3ff404e52e32088f12fe31cffd9603fe
3
+ metadata.gz: 558f2096b4d641e5be68601076bc8a4ae750c176
4
+ data.tar.gz: 75ef7026da57f7b996d05491854b640a31dda90b
5
5
  SHA512:
6
- metadata.gz: 143381f6f9f12c2dceb6edb2cdaacf4065ef3baf766a058ae817e303841308afb6186c091d9c41f2733f256649cc9a21f5eb085aed9017dc482c9f4dca932582
7
- data.tar.gz: de63e90529ad0b13345fbcd5e67e0df67f07c0745367637769840cb0bd766a40bd9b3586d9e62a0d708a8f56a097cb4293260160ffd9022eeac0290a7dece74e
6
+ metadata.gz: 29677e804456243f4d60a7b5f5fa8b3fa4d9f4075b4765142a430a05c095453731ef3865a369ad90d9de1947931f3b1cad143ff7d8c5683499e1b265ae728d03
7
+ data.tar.gz: 0f020c9b17533498f6c30d2d2a37c03e0dc3e113b8c62d25841f5391ba9fc2bcc85e25a47ea2d2674546e913b0b96e097a4f79941430ecfe9084121d757fa41d
data/.gitignore CHANGED
@@ -48,3 +48,7 @@ pkg
48
48
  .project
49
49
  .buildpath
50
50
  .cache
51
+
52
+ # Nucleon files
53
+ .project_cache
54
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.2.13
@@ -3,44 +3,44 @@ module Nucleon
3
3
  module Mixin
4
4
  module Action
5
5
  module Commit
6
-
6
+
7
7
  #-----------------------------------------------------------------------------
8
8
  # Settings
9
-
9
+
10
10
  def commit_config(optional = true)
11
-
11
+
12
12
  if optional
13
13
  register_bool :commit, :false, 'nucleon.core.mixin.action.commit.options.commit'
14
14
  else
15
15
  settings[:commit] = true
16
16
  end
17
-
17
+
18
18
  register_bool :allow_empty, true, 'nucleon.mixin.core.action.commit.options.allow_empty'
19
19
  register_bool :propogate_commit, false, 'nucleon.core.mixin.action.commit.options.propogate_commit'
20
-
20
+
21
21
  register_str :message, '', 'nucleon.core.mixin.action.commit.options.message'
22
-
22
+
23
23
  register_str :author, nil, 'nucleon.core.mixin.action.commit.options.author' do |value|
24
24
  if value.nil? || value.strip =~ /^[A-Za-z\s]+<\s*[^@]+@[^>]+\s*>$/
25
25
  next true
26
26
  end
27
- warn('corl.core.mixin.action.commit.errors.author', { :value => value })
27
+ warn('nucleon.core.mixin.action.commit.errors.author', { :value => value })
28
28
  false
29
29
  end
30
30
  end
31
-
31
+
32
32
  #---
33
-
33
+
34
34
  def commit_ignore
35
35
  [ :commit, :allow_empty, :propogate_commit, :message, :author ]
36
36
  end
37
-
37
+
38
38
  #-----------------------------------------------------------------------------
39
39
  # Operations
40
-
40
+
41
41
  def commit(project, files = '.')
42
42
  success = true
43
-
43
+
44
44
  if project && settings[:commit]
45
45
  success = project.commit(files, extended_config(:commit, {
46
46
  :allow_empty => settings[:allow_empty],
@@ -544,25 +544,28 @@ class Action < Nucleon.plugin_class(:nucleon, :base)
544
544
  end
545
545
 
546
546
  Nucleon.loaded_plugins(:nucleon, :action).each do |provider, data|
547
- description = data[:class].describe
548
- data[:description] = description
549
- data[:_weight] = description[:weight]
547
+ description = data[:class].describe
550
548
 
551
- keys = [ description[:namespace], description[:group], description[:action] ].flatten.compact
552
- action_config.set(keys, data)
549
+ unless description.nil? || !description.is_a?(Hash)
550
+ data[:description] = description
551
+ data[:_weight] = description[:weight]
553
552
 
554
- keys.pop
553
+ keys = [ description[:namespace], description[:group], description[:action] ].flatten.compact
554
+ action_config.set(keys, data)
555
555
 
556
- while ! keys.empty?
557
- group_config = action_config.get(keys)
556
+ keys.pop
558
557
 
559
- if group_config.has_key?(:_weights)
560
- group_config[:_weights].push(description[:weight])
561
- else
562
- action_config.set([ keys, :_weights ], [ description[:weight] ])
558
+ while ! keys.empty?
559
+ group_config = action_config.get(keys)
560
+
561
+ if group_config.has_key?(:_weights)
562
+ group_config[:_weights].push(description[:weight])
563
+ else
564
+ action_config.set([ keys, :_weights ], [ description[:weight] ])
565
+ end
566
+ action_config.set([ keys, :_weight ], group_config[:_weights].inject(0.0) { |sum, el| sum + el } / group_config[:_weights].size)
567
+ keys.pop
563
568
  end
564
- action_config.set([ keys, :_weight ], group_config[:_weights].inject(0.0) { |sum, el| sum + el } / group_config[:_weights].size)
565
- keys.pop
566
569
  end
567
570
  end
568
571
 
@@ -28,9 +28,10 @@ class Project < Nucleon.plugin_class(:nucleon, :base)
28
28
  logger.info("Creating new project at #{directory} with #{provider}")
29
29
 
30
30
  return Nucleon.project(config.import({
31
- :name => directory,
32
- :directory => directory,
33
- :nucleon_file => config.get(:nucleon_file, true)
31
+ :name => directory,
32
+ :directory => directory,
33
+ :nucleon_cache => config.get(:nucleon_cache, true),
34
+ :nucleon_file => config.get(:nucleon_file, true)
34
35
  }), provider)
35
36
 
36
37
  else
@@ -71,8 +72,10 @@ class Project < Nucleon.plugin_class(:nucleon, :base)
71
72
  pull if get(:pull, false)
72
73
 
73
74
  unless reload
74
- @cache = Util::Cache.new(directory, Nucleon.sha1(plugin_name), '.project_cache')
75
- init_cache
75
+ if get(:nucleon_cache, true)
76
+ @cache = Util::Cache.new(directory, Nucleon.sha1(plugin_name), '.project_cache')
77
+ init_cache
78
+ end
76
79
 
77
80
  if get(:nucleon_file, true) && ( get(:nucleon_resave, false) || self.class.load_project_info(directory).empty? )
78
81
  self.class.store_project_info(directory, plugin_provider, Util::Data.subset(export, [
@@ -26,7 +26,7 @@ class Cache < Core
26
26
  @cache_path = File.join(@cache_root, @cache_filename)
27
27
 
28
28
  unless File.exist?(file)
29
- parser = CORL.translator({}, translator)
29
+ parser = Nucleon.translator({}, translator)
30
30
  Disk.write(file, parser.generate({}))
31
31
  end
32
32
  load
@@ -126,7 +126,7 @@ class Cache < Core
126
126
  @@cache_lock.synchronize do
127
127
  logger.info("Loading #{translator} translated cache from #{file}")
128
128
 
129
- parser = CORL.translator({}, translator)
129
+ parser = Nucleon.translator({}, translator)
130
130
  raw = Disk.read(file)
131
131
 
132
132
  if parser && raw && ! raw.empty?
@@ -150,7 +150,7 @@ class Cache < Core
150
150
  @status = 255
151
151
 
152
152
  @@cache_lock.synchronize do
153
- if renderer = CORL.translator({}, translator)
153
+ if renderer = Nucleon.translator({}, translator)
154
154
  rendering = renderer.generate(export)
155
155
 
156
156
  Nucleon.remove_plugin(renderer)
data/nucleon.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: nucleon 0.2.12 ruby lib
5
+ # stub: nucleon 0.2.13 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nucleon"
9
- s.version = "0.2.12"
9
+ s.version = "0.2.13"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Adrian Webb"]
14
- s.date = "2015-04-29"
14
+ s.date = "2015-09-05"
15
15
  s.description = "\nA framework that provides a simple foundation for building Ruby applications that are:\n\n* Highly configurable (with both distributed and persistent configurations)\n* Extremely pluggable and extendable\n* Easily parallel\n\nNote: This framework is still very early in development!\n"
16
16
  s.email = "adrian.webb@coralnexus.com"
17
17
  s.executables = ["nucleon"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nucleon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Webb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r