rubyment 0.7.25752196 → 0.7.25752271

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. checksums.yaml +4 -4
  2. data/lib/rubyment.rb +52 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ff1f7d16c03cf284f9c40a12b9f9fb4a9461703
4
- data.tar.gz: 716243cf167c62a24a6b27d637a82d54459b1cc6
3
+ metadata.gz: 6fba539ff6f78991f287f12e659693ed5a2a1bdd
4
+ data.tar.gz: 32dcb1fb4062d6de26fd7319bd42b480fc72888f
5
5
  SHA512:
6
- metadata.gz: 5220772a0d31f7acffe2ec685f3538baef96dd56f0dfad3282e29133dbeb5ef157a993e26c6e6313b21cbd4ae94ba5f275bd058c35f43c535245eb576323bf20
7
- data.tar.gz: 789476d027b047058543b76143e71f149f3544b487a14f6ecc54f3d3c6f6903d8e9296aaaca75aea37cf1126f19554900d343fa2020041b1d65578c59a867deb
6
+ metadata.gz: a0cbf91c10a8c2b630c457a446d307244fb55d1aeb5ac7592b1a31b26a3cb823a8522150937c465b63368df39806dfb5f86cf62f9b8dffa142eaffa5bb934b5e
7
+ data.tar.gz: 880fee67876c2d3cf7b982aafe0acc191ac221398a30adb24ff495014f8e2cfb2615d106f5d7a6a16cc04b8ecc77213772b3b46915418da9231f4f5fc51dcae8
@@ -754,6 +754,57 @@ module RubymentInternalModule
754
754
  end
755
755
 
756
756
 
757
+ =begin
758
+ The actual release of rubyment it is not tied
759
+ to the version returned by #version (that's the
760
+ execution version).
761
+ This function returns a SHA256 hex digest (string)
762
+ for this file, which is unique per file change set.
763
+ However, it's not sequencial, and therefore not
764
+ used for versioning.
765
+ =end
766
+ def rubyment_file_sha256
767
+ require 'openssl'
768
+ (Digest::SHA256.hexdigest File.read __FILE__)
769
+ end
770
+
771
+
772
+ =begin
773
+ By default, @memory (see rubyment_memory__ functions),
774
+ is lost after a rubyment invocation.
775
+
776
+ This function allows a rudimentar method of persisting
777
+ the memory (just that "on load" method is used, check
778
+ #help__concept__rubyment_memory_persistence ;
779
+ here rubyment_memory__merge_shallow_on_load_json_file but
780
+ it will be replaced by a deep version when that's available),
781
+ based on the current PWD.
782
+
783
+ The invocation lines will be logged along
784
+ with their results in memory.rubyment.json. Just try running
785
+ rubyment multiple times and check that file.
786
+
787
+ Note: changed running dir, another context,
788
+ another memory. If you return to the current
789
+ dir you can retake the state. Either carry memory.rubyment.json
790
+ around or symlink it, if really needed to run rubyment from
791
+ another dir.
792
+ =end
793
+ def invoke_pwd_persistent *args
794
+ rubyment_memory__merge_shallow_on_load_json_file
795
+ result = invoke *args
796
+ @memory[:invocation_history] ||= Array.new
797
+ time = time__now_strftime_default
798
+ @memory[:invocation_history].push({
799
+ "time" => time,
800
+ "command" => args,
801
+ "result" => result,
802
+ })
803
+ rubyment_memory__to_json_file
804
+ result
805
+ end
806
+
807
+
757
808
  end # of RubymentInternalModule
758
809
 
759
810
 
@@ -1140,6 +1191,7 @@ module RubymentExperimentModule
1140
1191
  =end
1141
1192
  def file__json args=[]
1142
1193
  require 'json'
1194
+ require 'fileutils'
1143
1195
  file_path,
1144
1196
  enum,
1145
1197
  reserved = args
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.25752196
4
+ version: 0.7.25752271
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribamar Santarosa