Method: Mushy::FileWatch.details

Defined in:
lib/mushy/fluxs/file_watch.rb

.detailsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/mushy/fluxs/file_watch.rb', line 4

def self.details
  {
    name: 'FileWatch',
    title: 'Start a flow when files change',
    fluxGroup: { name: 'Starters', position: 0 },
    description: 'Watch for file changes.',
    config: {
      directory: {
        description: 'The directory to watch, defaults to the current directory.',
        type: 'text',
        shrink: true,
        value: ''
      },
      include_all_file_details: {
        description: 'If true, returns all details for the file. If false, just path & name are returned.',
        type: 'boolean',
        shrink: true,
        value: ''
      },
      merge_all_file_changes: {
        description: 'If true, all changes are merged into one "files". If false, added/modified/removed are returned separately.',
        type: 'boolean',
        shrink: true,
        value: ''
      },
      include_added: {
        description: 'Include added fields, defaults to true.',
        type: 'boolean',
        shrink: true,
        value: ''
      },
      include_modified: {
        description: 'Include modified fields, defaults to true.',
        type: 'boolean',
        shrink: true,
        value: ''
      },
      include_removed: {
        description: 'Include removed fields, defaults to true.',
        type: 'boolean',
        shrink: true,
        value: ''
      }
    },
    examples: {
      'Files Added' => {
        description: 'When a file is added, this type of result will be returned.',
        result: {
          modified: [],
          added: [{ path: '/home/pi/Desktop/mushy/bin/hey.txt', directory: '/home/pi/Desktop/mushy/bin', name: 'hey.txt' }],
          removed: []
        }
      },
      'Files Removed' => {
        description: 'When a file is deleted, this type of result will be returned.',
        result: {
          modified: [],
          added: [],
          removed: [{ path: '/home/pi/Desktop/mushy/mushy-0.15.3.gem', directory: '/home/pi/Desktop/mushy', name: 'mushy-0.15.3.gem'}]
        }
      },
      'Files Modified' => {
        description: 'When a file is modified, this type of result will be returned.',
        result: {
          modified: [{ path: '/home/pi/Desktop/mushy/lib/mushy/fluxs/environment.rb', directory: '/home/pi/Desktop/mushy/lib/mushy/fluxs/environment.rb', name: 'environment.rb' }],
          added: [],
          removed: []
        }
      }
    }
  }
end