dev 1.0.77 → 1.0.78

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.
Files changed (3) hide show
  1. data/lib/dev/Environment.rb +15 -0
  2. data/lib/dev/Project.rb +11 -7
  3. metadata +1 -1
@@ -60,6 +60,21 @@ class Environment
60
60
  hash
61
61
  end
62
62
 
63
+ def self.user
64
+ user = ENV['USER'] if !ENV['USER'].nil? #on Unix
65
+ user = ENV['USERNAME'] if !ENV['USERNAME'].nil? #on Windows
66
+ end
67
+
68
+ def self.machine
69
+ if !ENV['COMPUTERNAME'].nil?
70
+ return ENV['COMPUTERNAME']
71
+ end
72
+
73
+ machine = nil
74
+ machine = `hostname` if machine.nil?
75
+ machine = machine.split('.')[0] if machine.include?('.')
76
+ end
77
+
63
78
  end
64
79
 
65
80
  end # module Dev
@@ -114,9 +114,13 @@ class Project < Hash
114
114
  "?"
115
115
  end
116
116
 
117
+ def context
118
+ Dev::Environment.user + "." + Dev::Environment.machine
119
+ end
120
+
117
121
  def check
118
- puts " default.taskstamp exists." if File.exists?("default.taskstamp")
119
- puts " default.taskstamp does not exist" unless File.exists?("default.taskstamp")
122
+ puts " default.taskstamp." + context + " exists." if File.exists?("default.taskstamp."+context)
123
+ puts " default.taskstamp." + context + " does not exist" unless File.exists?("default.taskstamp."+context)
120
124
 
121
125
  begin
122
126
  hasdiff = has_diff
@@ -127,23 +131,23 @@ class Project < Hash
127
131
  puts " no differences detected." unless hasdiff
128
132
  puts " detected differences." if hasdiff
129
133
 
130
- if File.exists?("default.taskstamp") && !hasdiff
134
+ if File.exists?("default.taskstamp."+context) && !hasdiff
131
135
  #puts " nothing to do"
132
136
  update
133
137
  exit
134
138
  end
135
139
 
136
- #if !has_diff and File.exists?("default.taskstamp")
140
+ #if !has_diff and File.exists?("default.taskstamp."+context)
137
141
  # puts " no differences detected."
138
- # puts " default.taskstamp exists."
142
+ # puts " default.taskstamp." + context + " exists."
139
143
  # exit
140
144
  #end
141
145
  #puts " detected differences" if has_diff
142
- #puts " default.taskstamp does not exist" unless File.exists?("default.taskstamp")
146
+ #puts " default.taskstamp." + context + " does not exist" unless File.exists?("default.taskstamp." + context)
143
147
  end
144
148
 
145
149
  def stamp_task(name)
146
- File.open("#{name}.taskstamp","w") { |f| f.write(Time.now.to_s) }
150
+ File.open("#{name}.taskstamp." + context,"w") { |f| f.write(Time.now.to_s) }
147
151
  end
148
152
 
149
153
  def replace
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.77
4
+ version: 1.0.78
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: