doublehelix 1.0

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 (6) hide show
  1. data/History.txt +6 -0
  2. data/Manifest.txt +5 -0
  3. data/README.txt +112 -0
  4. data/Rakefile +11 -0
  5. data/lib/doublehelix.rb +19 -0
  6. metadata +94 -0
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2010-01-19
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
@@ -0,0 +1,5 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ lib/doublehelix.rb
@@ -0,0 +1,112 @@
1
+ = doublehelix
2
+
3
+ * http://github.com/mame/doublehelix
4
+
5
+ == DESCRIPTION:
6
+
7
+ doublehelix obfuscates Ruby codes in Double-helix style.
8
+ This is inspired by Perl's Acme::DoubleHelix.
9
+
10
+ == FEATURES/PROBLEMS:
11
+
12
+
13
+ == SYNOPSIS:
14
+
15
+ This is a ``Hello, world!'' program obfucated by doublehelix:
16
+
17
+ require "doublehelix"
18
+
19
+ AT
20
+ A--T
21
+ T---A
22
+ G----C
23
+ G----C
24
+ G----C
25
+ T---A
26
+ G--C
27
+ AT
28
+ GC
29
+ T--A
30
+ G---C
31
+ T----A
32
+ A----T
33
+ T----A
34
+ G---C
35
+ C--G
36
+ AT
37
+ CG
38
+ A--T
39
+ A---T
40
+ C----G
41
+ A----T
42
+ G----C
43
+ G---C
44
+ G--C
45
+ CG
46
+ GC
47
+ A--T
48
+ T---A
49
+ C----G
50
+ G----C
51
+ A----T
52
+ T---A
53
+ C--G
54
+ GC
55
+ TA
56
+ T--A
57
+ C---G
58
+ G----C
59
+ A----T
60
+ T----A
61
+ C---G
62
+ A--T
63
+ AT
64
+ AT
65
+ C--G
66
+ A---T
67
+ T----A
68
+ G----C
69
+ T----A
70
+ G---C
71
+ T--A
72
+ TA
73
+ CG
74
+ G--C
75
+ C---G
76
+ A----T
77
+ T----A
78
+ G----C
79
+ A---T
80
+ T--A
81
+ CG
82
+ GC
83
+ A--T
84
+ G---C
85
+ C----G
86
+ G----C
87
+ G----C
88
+ A---T
89
+ C--G
90
+ AT
91
+ CG
92
+ A--T
93
+ C---G
94
+ A----T
95
+
96
+ You can obfuscate your script by doublehelix method:
97
+
98
+ require "doublehelix"
99
+ puts doublehelix('puts"Hello, world!"')
100
+
101
+ == REQUIREMENTS:
102
+
103
+ None
104
+
105
+ == INSTALL:
106
+
107
+ * gem install doublehelix
108
+
109
+ == LICENSE:
110
+
111
+ Copyright:: Yusuke Endoh <mame@tsg.ne.jp>
112
+ License:: Ruby's
@@ -0,0 +1,11 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.new('doublehelix', '1.0') do |p|
7
+ p.rubyforge_name = 'doublehelix' # if different than lowercase project name
8
+ p.developer('Yusuke Endoh', 'mame@tsg.ne.jp')
9
+ end
10
+
11
+ # vim: syntax=Ruby
@@ -0,0 +1,19 @@
1
+ $code = ""
2
+ Object.instance_eval do
3
+ def const_missing(s); $code << s.to_s; 0; end
4
+ remove_const(:GC) # Holy moly!
5
+ end
6
+ at_exit do
7
+ dict = { "AT"=>"00", "CG"=>"01", "GC"=>"10", "TA"=>"11" }
8
+ eval([$code.gsub(/../) {|s| dict[s] }].pack("b*"))
9
+ end
10
+
11
+ def doublehelix(src)
12
+ dict = { "00"=>["A","T"], "01"=>["C","G"], "10"=>["G","C"], "11"=>["T","A"] }
13
+ format = [[1,0], [0,2], [0,3], [0,4], [1,4], [2,4], [3,3], [4,2], [5,0]]
14
+ format += format.reverse
15
+ %(require "doublehelix"\n\n) + src.unpack("b*").first.gsub(/../) do |s|
16
+ format << (offset, dist = format.shift)
17
+ " " * offset + dict[s] * ("-" * dist) + "\n"
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: doublehelix
3
+ version: !ruby/object:Gem::Version
4
+ version: "1.0"
5
+ platform: ruby
6
+ authors:
7
+ - Yusuke Endoh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-20 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rubyforge
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.3
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: gemcutter
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.5.0
44
+ version:
45
+ description: |-
46
+ doublehelix obfuscates Ruby codes in Double-helix style.
47
+ This is inspired by Perl's Acme::DoubleHelix.
48
+ email:
49
+ - mame@tsg.ne.jp
50
+ executables: []
51
+
52
+ extensions: []
53
+
54
+ extra_rdoc_files:
55
+ - History.txt
56
+ - Manifest.txt
57
+ - README.txt
58
+ files:
59
+ - History.txt
60
+ - Manifest.txt
61
+ - README.txt
62
+ - Rakefile
63
+ - lib/doublehelix.rb
64
+ has_rdoc: true
65
+ homepage: http://github.com/mame/doublehelix
66
+ licenses: []
67
+
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --main
71
+ - README.txt
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ version:
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ requirements: []
87
+
88
+ rubyforge_project: doublehelix
89
+ rubygems_version: 1.3.5
90
+ signing_key:
91
+ specification_version: 3
92
+ summary: doublehelix obfuscates Ruby codes in Double-helix style
93
+ test_files: []
94
+