ditto_code 0.2.0 → 0.2.1

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: 849da2b6c7fedf77d9bff8d4aa49b31f0d780841
4
- data.tar.gz: 35951ad9722725e13824825daa27dec96a04d342
3
+ metadata.gz: 60c92b4e27799c8657dbe623ef4afc2d94e3a3be
4
+ data.tar.gz: 92d3a129c6145f515241a9fdea839df3a00d8b46
5
5
  SHA512:
6
- metadata.gz: 7a1dc058670de2a6027988b46bb6f7e0449d65ce271b7a8fd7c58c15a7ed6324eacf5f8c00e6f128f61d5db3f8d87414e9c7740d35f0b225f16bac8d80d0d0b0
7
- data.tar.gz: b565a9e6182412fbb4351c21125e5844f52fd23ea04fdf265beb619df28e474d700de4aca45f0908b64c37b4db6daea211248e7d2e588dd271c3babbb79bfaa2
6
+ metadata.gz: 19dfffbea20e4cd363397c62fde80c64e9b9eb03518578161df35994a47ad7dac169d817045bfb535ef92b633dd7be9e18d290ceb5af7996b13512799c5c631d
7
+ data.tar.gz: ef1d1716df484c4ceaa53fb9f8e3d4027baa6203d1f8b6d71e8ce0b5319f997f132a40a61d8a514cd58764b1203f77346610e1c9cf11976f9b6fadfd85388664
@@ -3,6 +3,9 @@ module DittoCode
3
3
  @initialize = false
4
4
 
5
5
  module Exec
6
+
7
+ # Exec the block of code if its environment
8
+ # coincide with the global environment
6
9
  def self.if (environment)
7
10
 
8
11
  # check the env code
@@ -15,5 +18,22 @@ module DittoCode
15
18
  end
16
19
  end
17
20
 
21
+ # Return true if the environment defined in the line
22
+ # coincide with the global environment. This function is
23
+ # used in conditional lines
24
+ def self.is (environment)
25
+
26
+ # check the env code
27
+ unless @initialize
28
+ DittoCode::Environments.check_env
29
+ end
30
+
31
+ if DittoCode::Environments.isIncluded? environment
32
+ true
33
+ else
34
+ false
35
+ end
36
+
37
+ end
18
38
  end
19
39
  end
@@ -129,7 +129,6 @@ module DittoCode
129
129
  end
130
130
 
131
131
  else
132
- # We delete the line require 'ditto_code'
133
132
  dittos += 1
134
133
  end
135
134
 
@@ -139,7 +138,7 @@ module DittoCode
139
138
  if @removed
140
139
  say "[ "+"OK".color("64d67f")+" ] file #{@dir_name}#{@file_name} as been removed"
141
140
  elsif @verbose || dittos != 0
142
- say "[ "+"OK".color("64d67f")+" ] #{dittos} lines ditted on #{@dir_name}#{@file_name}"
141
+ printf("Ditto say -> [ "+"OK".color("64d67f")+" ] %5s lines ditted on #{@dir_name}#{@file_name}\n", dittos)
143
142
  end
144
143
 
145
144
  # Close and save the file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ditto_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel M Miguel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-31 00:00:00.000000000 Z
11
+ date: 2014-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: indentation
@@ -38,6 +38,90 @@ dependencies:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry-remote
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry-nav
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
41
125
  description: Transform your ruby code based on a custom variable.
42
126
  email: angel@laux.es
43
127
  executables: